一、下载CKEditor
1. 直接下载地址,当前最新版本为3.6:http://ckeditor.com/download
二、安装CKEditor
解压ckeditor_3.5.zip,得到ckeditor文件夹,将ckeditor整个文件夹复制到项目工程的根目录下,即WebContent下
目录如下:
三、验证CKEditor是否安装成功
部署运行项目,访问: http://localhost/项目名称/ckeditor/_samples/index.html(此处项目名为sample)
则可出现 “CKEditor Samples List” 的Demo页面,说明CKeditor已安装成功
四、编写一个JSP(test.jsp)代码如下:
<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<body>
<head>
<script type="text/javascript" src="<%=request.getContextPath()%>/ckeditor/ckeditor.js"></script>
<script type="text/javascript">
//<![CDATA[
CKEDITOR.replace('content',{toolbar:'Full',skin:'kama'});
//]]>
</script>
<title>jCuckoo 's ckedit page</title>
</head>
<body>
<textarea class="ckeditor" cols="80" id="content" name="content" rows="10">
CKEditor Test......(此处的内容会在编辑器中显示)</textarea>
</body>
</html>
五、运行结果如下: