%@ taglib uri="http://ckeditor.com" prefix="ckeditor" %> <%@page import="com.ckeditor.CKEditorConfig"%> <%@page import="java.util.ArrayList"%> <%@page import="java.util.List"%> <%@page import="java.util.HashMap"%> <%@page import="java.util.Map"%> <%@page language="Java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
This sample shows how to create a CKEditor instance with Java.
<% String value = "My first <strong>CKEditor</strong> Java tag"; CKEditorConfig settings = new CKEditorConfig(); settings.addConfigValue("width", "500"); settings.addConfigValue("toolbar", "Basic"); %> <ckeditor:editor basePath="/ckeditor/" config="<%=settings %>" editor="textarea_id" value="<%= value %>"/>
Note that textarea_id
in the code above is the id
and name
attribute of
the <textarea>
element that will be created.