我的环境及开发工具:jdk1.6.0_10+tomcat6.0+myeclipse6.5
1. FCKeditor简介:
FCKeditor是一个专门使用在网页上属于开放源代码的所见即所得文字编辑器。它志于轻量化,不需要太复杂的安装步骤即可使用。它可和PHP、JavaScript、ASP、ASP.NET、ColdFusion、Java、以及ABAP等不同的编程语言相结合。“FCKeditor”名称中的“FCK” 是这个编辑器的作者的名字Frederico Caldeira Knabben的缩写。FCKeditor 相容于绝大部分的网页浏览器。
2. 下载地址:
下载页面:
http://sourceforge.net/project/showfiles.php?group_id=75348&package_id=129511
fckeditor-java-2.4.1-bin.zip
http://switch.dl.sourceforge.net/sourceforge/fckeditor/fckeditor-java-2.4.1-bin.zip
FCKeditor_2.6.4.zip
http://jaist.dl.sourceforge.net/sourceforge/fckeditor/FCKeditor_2.6.4.zip
fckeditor-java-demo-2.4.1.war
http://nchc.dl.sourceforge.net/sourceforge/fckeditor/fckeditor-java-demo-2.4.1.war
fckeditor-java-2.4.1-src.zip
http://jaist.dl.sourceforge.net/sourceforge/fckeditor/fckeditor-java-2.4.1-src.zip
在你的Java Web 项目中用,只要下载fckeditor-java-2.4.1-bin.zip(含Jar包)和fckeditor-java-demo-2.4.1.war(fckeditor文件夹),把fckeditor-java-core-2.4.1.jar粘贴到lib目录下,把fckeditor文件夹放到项目中(比如根目录)
再加上这几个jar包:
3. web.xml配置:
加上:
<servlet> <servlet-name>Connector</servlet-name> <servlet-class>net.fckeditor.connector.ConnectorServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>Connector</servlet-name> <url-pattern>/fckeditor/editor/filemanager/connectors/*</url-pattern> </servlet-mapping>
4.在项目的src下建立fckeditor.properties 文件,添加以下代码:
connector.userActionImpl=net.fckeditor.requestcycle.impl.UserActionImpl
5. 测试:
test.jsp:
<%@ taglib uri="http://java.fckeditor.net" prefix="FCK" %>
<body style="text-align: center;">
<div style="text-align: center;width: 600pt">
<h2>FckEditor测试</h2>
<hr>
<form action="show.jsp" method="post">
<FCK:editor instanceName="content" height="300px">
</FCK:editor>
<input type="submit" value="提交"/>
<input type="reset" value="重置"/>
</form>
</div>
</body>
show.jsp:
<body>
${param.content}
</body>
————————————————————————The End——————————————————————————