1. 下载fckeditor-java-demo-2.6.war和fckeditor-java-2.6-bin.tar.gz
下载地址: http://sourceforge.net/projects/fckeditor/files/FCKeditor.Java/2.6/
2. 解压fckeditor-java-demo-2.6.war, 获取以下资源
主目录下的: fckeditor文件夹
lib目录下的:
commons-fileupload-1.2.1.jar
commons-io-1.3.2.jar
imageinfo-1.9.jar
java-core-2.6.jar
slf4j-api-1.5.8.jar
slf4j-simple-1.5.8.jar
WEB-INF\classes目录下的:
fckeditor.properties
web.xml中的:
ConnectorServlet net.fckeditor.connector.ConnectorServlet 1 ConnectorServlet /fckeditor/editor/filemanager/connectors/*
3. 建立web项目sample
将fckeditor文件夹sample\WebContent\plugins\fckeditor
在lib中放入
commons-fileupload-1.2.1.jar
commons-io-1.3.2.jar
imageinfo-1.9.jar
java-core-2.6.jar
slf4j-api-1.5.8.jar
slf4j-simple-1.5.8.jar
在sample\src中放入(eclipse自动编译后会到classes目录下)
fckeditor.properties
在web.xml中加入
ConnectorServlet net.fckeditor.connector.ConnectorServlet 1 ConnectorServlet /plugins/fckeditor/editor/filemanager/connectors/*
4. 调整配置
fckeditor.properties
# allow client upload file to server connector.userActionImpl=net.fckeditor.requestcycle.impl.EnabledUserAction # user can see path connector.userFilesPath=/userfiles/fckeditor # user can store path connector.userFilesAbsolutePath=/userfiles/fckeditor # the default path of the editor fckeditor.basePath=/plugins/fckeditor
fckconfig.js
FCKConfig.AutoDetectLanguage = false ; FCKConfig.DefaultLanguage = 'zh-cn' ; // 可以加入自定义的工具栏 // custom your Toolbar and use it FCKConfig.ToolbarSets["Custom"] = [ ['Bold','Italic','-','OrderedList','UnorderedList','-','Link','Unlink'] ] ;
5. 使用
fckeditor.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib uri="http://java.fckeditor.net" prefix="FCK"%>use FCKeditor