开发环境: 
Tomcat6.0 MyEclipse 5.1.1

c 版本 FCKeditor_2.5 FCKeditor.Java 2.3

下载地址: http://www.fckeditor.net/download/default.html

开始:

新建工程,名称为 FCKeditor
解压 c_2.5 包中的 edit 文件夹到项目中的 WebRoot\fck目录

解压 FCKeditor_2.5 包中的 fckconfig.js、fckeditor.js、fckstyles.xml、fcktemplates.xml 文件夹到项目中的 WebRoot\fck目录

解压 FCKeditor-2.3.zip 包中的 \web\WEB-INF\lib 下的两个 jar 文件到项目的 WebRoot\WEB-INF\lib 目录

解压 FCKeditor-2.3.zip 包中的 \src 下的 FCKeditor.tld 文件到项目的 WebContent\WEB-INF 目录

刷新一下工程,有一个文件会出错,不管它是什么错,将错误信息清除

删除 WebContent\edit 目录下的 _source 文件夹

修改 web.xml 文件,加入以下内容


代码

 1fckeditor的jsp中的使用<servlet> 
 2fckeditor的jsp中的使用        <servlet-name>Connector</servlet-name> 
 3fckeditor的jsp中的使用        <servlet-class>com.fredck.FCKeditor.connector.ConnectorServlet</servlet-class> 
 4fckeditor的jsp中的使用        <init-param> 
 5fckeditor的jsp中的使用            <param-name>baseDir</param-name> 
 6fckeditor的jsp中的使用            <!-- 此为文件浏览路径 --> 
 7fckeditor的jsp中的使用            <param-value>/UserFiles/</param-value> 
 8fckeditor的jsp中的使用        </init-param> 
 9fckeditor的jsp中的使用        <init-param> 
10fckeditor的jsp中的使用            <param-name>debug</param-name> 
11fckeditor的jsp中的使用            <param-value>true</param-value> 
12fckeditor的jsp中的使用        </init-param> 
13fckeditor的jsp中的使用        <load-on-startup>1</load-on-startup> 
14fckeditor的jsp中的使用    </servlet> 
15fckeditor的jsp中的使用
16fckeditor的jsp中的使用    <servlet> 
17fckeditor的jsp中的使用        <servlet-name>SimpleUploader</servlet-name> 
18fckeditor的jsp中的使用        <servlet-class>com.fredck.FCKeditor.uploader.SimpleUploaderServlet</servlet-class> 
19fckeditor的jsp中的使用
20fckeditor的jsp中的使用       <init-param> 
21fckeditor的jsp中的使用            <param-name>baseDir</param-name> 
22fckeditor的jsp中的使用            <!-- 此为文件上传路径,需要在WebRoot 目录下新建 UserFiles 文件夹 --> 
23fckeditor的jsp中的使用            <!-- 根据文件的类型还需要新建相关的文件夹 Image、 Flash --> 
24fckeditor的jsp中的使用            <param-value>/UserFiles/</param-value> 
25fckeditor的jsp中的使用        </init-param> 
26fckeditor的jsp中的使用        <init-param> 
27fckeditor的jsp中的使用            <param-name>debug</param-name> 
28fckeditor的jsp中的使用            <param-value>true</param-value> 
29fckeditor的jsp中的使用        </init-param> 
30fckeditor的jsp中的使用        <init-param> 
31fckeditor的jsp中的使用            <!-- 此参数为是否开启上传功能 --> 
32fckeditor的jsp中的使用            <param-name>enabled</param-name> 
33fckeditor的jsp中的使用            <param-value>false</param-value> 
34fckeditor的jsp中的使用        </init-param> 
35fckeditor的jsp中的使用        <init-param> 
36fckeditor的jsp中的使用            <param-name>AllowedExtensionsFile</param-name> 
37fckeditor的jsp中的使用            <param-value></param-value> 
38fckeditor的jsp中的使用        </init-param> 
39fckeditor的jsp中的使用        <init-param> 
40fckeditor的jsp中的使用            <!-- 此参数为文件过滤,以下的文件类型都不可以上传 --> 
41fckeditor的jsp中的使用            <param-name>DeniedExtensionsFile</param-name> 
42fckeditor的jsp中的使用            <param-value>php|php3|php5|phtml|asp|aspx|ascx|jsp|cfm|cfc|pl|bat|exe|dll|reg|cgi</param-value> 
43fckeditor的jsp中的使用        </init-param> 
44fckeditor的jsp中的使用        <init-param> 
45fckeditor的jsp中的使用            <param-name>AllowedExtensionsImage</param-name>
46fckeditor的jsp中的使用            <param-value>jpg|gif|jpeg|png|bmp</param-value> 
47fckeditor的jsp中的使用        </init-param> 
48fckeditor的jsp中的使用        <init-param> 
49fckeditor的jsp中的使用            <param-name>DeniedExtensionsImage</param-name> 
50fckeditor的jsp中的使用            <param-value></param-value> 
51fckeditor的jsp中的使用        </init-param> 
52fckeditor的jsp中的使用        <init-param> 
53fckeditor的jsp中的使用            <param-name>AllowedExtensionsFlash</param-name> 
54fckeditor的jsp中的使用            <param-value>swf|fla</param-value> 
55fckeditor的jsp中的使用        </init-param> 
56fckeditor的jsp中的使用        <init-param> 
57fckeditor的jsp中的使用            <param-name>DeniedExtensionsFlash</param-name> 
58fckeditor的jsp中的使用            <param-value></param-value> 
59fckeditor的jsp中的使用        </init-param> 
60fckeditor的jsp中的使用        <load-on-startup>1</load-on-startup> 
61fckeditor的jsp中的使用    </servlet> 
62fckeditor的jsp中的使用    
63fckeditor的jsp中的使用<servlet-mapping> 
64fckeditor的jsp中的使用    <servlet-name>Connector</servlet-name> 
65fckeditor的jsp中的使用    <url-pattern>/FCKeditor/fck/editor/filemanager/browser/default/connectors/jsp/connector</url-pattern> 
66fckeditor的jsp中的使用</servlet-mapping> 
67fckeditor的jsp中的使用
68fckeditor的jsp中的使用<servlet-mapping> 
69fckeditor的jsp中的使用    <servlet-name>SimpleUploader</servlet-name> 
70fckeditor的jsp中的使用    <url-pattern>/FCKeditor/fck/editor/filemanager/upload/simpleuploader</url-pattern> 
71fckeditor的jsp中的使用</servlet-mapping> 

新建一个提交页 test.jsp 文件和一个接收页 show.jsp 文件

test.jsp 代码如下:


代码

 1fckeditor的jsp中的使用<%@ page contentType = "text/html;charset=UTF-8" language = "java" %> 
 2fckeditor的jsp中的使用<%@ taglib uri = "/WEB-INF/FCKeditor.tld" prefix = "fck" %><html> 
 3fckeditor的jsp中的使用<head> 
 4fckeditor的jsp中的使用    <title> Test </title> 
 5fckeditor的jsp中的使用</head> <body> 
 6fckeditor的jsp中的使用    <FORM action = "test1.jsp" > 
 7fckeditor的jsp中的使用    <fck:editor id = "testfck" basePath = "/FCKeditor/fck/" 
 8fckeditor的jsp中的使用    height = "100%" 
 9fckeditor的jsp中的使用    skinPath = "/FCKeditor/fck/editor/skins/default/" 
10fckeditor的jsp中的使用    toolbarSet = "Default" 
11fckeditor的jsp中的使用    imageBrowserURL = "/FCKeditor/fck/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector" 
12fckeditor的jsp中的使用linkBrowserURL = "/FCKeditor/fck/editor/filemanager/browser/default/browser.html?Connector=connectors/jsp/connector" 
13fckeditor的jsp中的使用flashBrowserURL = "/FCKeditor/fck/editor/filemanager/browser/default/browser.html?Type=Flash&Connector=connectors/jsp/connector" 
14fckeditor的jsp中的使用imageUploadURL = "/FCKeditor/fck/editor/filemanager/upload/simpleuploader?Type=Image" 
15fckeditor的jsp中的使用    linkUploadURL = "/FCKeditor/fck/editor/filemanager/upload/simpleuploader?Type=File" 
16fckeditor的jsp中的使用flashUploadURL = "/FCKeditor/fck/editor/filemanager/upload/simpleuploader?Type=Flash" > 
17fckeditor的jsp中的使用</fck:editor> 
18fckeditor的jsp中的使用<input type="submit" /> 
19fckeditor的jsp中的使用    </FORM> 
20fckeditor的jsp中的使用</body> 
21fckeditor的jsp中的使用</html>

show.jsp 代码如下:

 

 1fckeditor的jsp中的使用<%@ page contentType = "text/html;charset=UTF-8" language = "java" %> 
 2fckeditor的jsp中的使用<%@ taglib uri = "/WEB-INF/FCKeditor.tld" prefix = "fck" %><html> 
 3fckeditor的jsp中的使用<head> 
 4fckeditor的jsp中的使用    <title> Test </title> 
 5fckeditor的jsp中的使用</head> <body> 
 6fckeditor的jsp中的使用    <FORM action = "test1.jsp" > 
 7fckeditor的jsp中的使用    <fck:editor id = "testfck" basePath = "/FCKeditor/fck/" 
 8fckeditor的jsp中的使用    height = "100%" 
 9fckeditor的jsp中的使用    skinPath = "/FCKeditor/fck/editor/skins/default/" 
10fckeditor的jsp中的使用    toolbarSet = "Default" 
11fckeditor的jsp中的使用    imageBrowserURL = "/FCKeditor/fck/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector" 
12fckeditor的jsp中的使用linkBrowserURL = "/FCKeditor/fck/editor/filemanager/browser/default/browser.html?Connector=connectors/jsp/connector" 
13fckeditor的jsp中的使用flashBrowserURL = "/FCKeditor/fck/editor/filemanager/browser/default/browser.html?Type=Flash&Connector=connectors/jsp/connector" 
14fckeditor的jsp中的使用imageUploadURL = "/FCKeditor/fck/editor/filemanager/upload/simpleuploader?Type=Image" 
15fckeditor的jsp中的使用    linkUploadURL = "/FCKeditor/fck/editor/filemanager/upload/simpleuploader?Type=File" 
16fckeditor的jsp中的使用flashUploadURL = "/FCKeditor/fck/editor/filemanager/upload/simpleuploader?Type=Flash" > 
17fckeditor的jsp中的使用</fck:editor> 
18fckeditor的jsp中的使用<input type="submit" /> 
19fckeditor的jsp中的使用    </FORM> 
20fckeditor的jsp中的使用</body> 
21fckeditor的jsp中的使用</html>


在 WebRoot 目录下新建 UserFiles 文件夹,在此文件夹下新建 Image 和 Flash 两个文件夹

这样就可以测试了

相关文章:

  • 2022-01-22
  • 2021-09-09
  • 2022-12-23
  • 2021-09-08
  • 2022-02-03
  • 2022-12-23
  • 2022-12-23
  • 2021-10-05
猜你喜欢
  • 2022-01-12
  • 2022-12-23
  • 2021-08-27
  • 2022-01-29
  • 2021-04-19
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案