1.       加压两个压缩文件,把fckeditor放入root目录下,fck改名大写,删掉sample文件夹.

2.并把ECKeditor-2.3.jar 和 commons-fileupload.jar拷贝到 项目\WebContent\WEB-INF\lib目录下
3.把 FCKeditor.tld拷贝到项目\WebContent\WEB-INF下
4.在web.xml里添加如下代码

代码
  1. <servlet>    
  2.   
  3.         <servlet-name>Connector</servlet-name>    
  4.   
  5.         <servlet-class>com.fredck.FCKeditor.connector.ConnectorServlet</servlet-class>    
  6.   
  7.         <init-param>    
  8.   
  9.             <param-name>baseDir</param-name>    
  10.   
  11.             <!-- 此为文件浏览路径 -->    
  12.   
  13.             <param-value>/UserFiles/</param-value>    
  14.   
  15.         </init-param>    
  16.   
  17.         <init-param>    
  18.   
  19.             <param-name>debug</param-name>    
  20.   
  21.             <param-value>true</param-value>    
  22.   
  23.         </init-param>    
  24.   
  25.         <load-on-startup>1</load-on-startup>    
  26.   
  27.     </servlet>    
  28.   
  29.      
  30.   
  31.     <servlet>    
  32.   
  33.         <servlet-name>SimpleUploader</servlet-name>    
  34.   
  35.         <servlet-class>com.fredck.FCKeditor.uploader.SimpleUploaderServlet</servlet-class>    
  36.   
  37.         <init-param>    
  38.   
  39.             <param-name>baseDir</param-name>    
  40.   
  41.             <!-- 此为文件上传路径,需要在WebRoot 目录下新建 UserFiles 文件夹 -->    
  42.   
  43.             <!-- 根据文件的类型还需要新建相关的文件夹 Image、 Flash -->    
  44.   
  45.             <param-value>/UserFiles/</param-value>    
  46.   
  47.         </init-param>    
  48.   
  49.         <init-param>    
  50.   
  51.             <param-name>debug</param-name>    
  52.   
  53.             <param-value>true</param-value>    
  54.   
  55.         </init-param>    
  56.   
  57.         <init-param>    
  58.   
  59.             <!-- 此参数为是否开启上传功能 -->    
  60.   
  61.             <param-name>enabled</param-name>    
  62.   
  63.             <param-value>true</param-value>    
  64.   
  65.         </init-param>    
  66.   
  67.         <init-param>    
  68.   
  69.             <param-name>AllowedExtensionsFile</param-name>    
  70.   
  71.             <param-value></param-value>    
  72.   
  73.         </init-param>    
  74.   
  75.         <init-param>    
  76.   
  77.             <!-- 此参数为文件过滤,以下的文件类型都不可以上传 -->    
  78.   
  79.             <param-name>DeniedExtensionsFile</param-name>    
  80.   
  81.             <param-value>php|php3|php5|phtml|asp|aspx|ascx|jsp|cfm|cfc|pl|bat|exe|dll|reg|cgi</param-value>    
  82.   
  83.         </init-param>    
  84.   
  85.         <init-param>    
  86.   
  87.             <param-name>AllowedExtensionsImage</param-name>    
  88.   
  89.             <param-value>jpg|gif|jpeg|png|bmp</param-value>    
  90.   
  91.         </init-param>    
  92.   
  93.         <init-param>    
  94.   
  95.             <param-name>DeniedExtensionsImage</param-name>    
  96.   
  97.             <param-value></param-value>    
  98.   
  99.         </init-param>    
  100.   
  101.         <init-param>    
  102.   
  103.             <param-name>AllowedExtensionsFlash</param-name>    
  104.   
  105.             <param-value>swf|fla</param-value>    
  106.   
  107.         </init-param>    
  108.   
  109.         <init-param>    
  110.   
  111.             <param-name>DeniedExtensionsFlash</param-name>    
  112.   
  113.             <param-value></param-value>    
  114.   
  115.         </init-param>    
  116.   
  117.         <load-on-startup>1</load-on-startup>    
  118.   
  119.     </servlet>    
  120.   
  121.      
  122.   
  123.   <servlet-mapping>    
  124.   
  125.     <servlet-name>Connector</servlet-name>    
  126.   
  127.     <url-pattern>/FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector</url-pattern>    
  128.   
  129.   </servlet-mapping>    
  130.   
  131.      
  132.   
  133.   <servlet-mapping>    
  134.   
  135.     <servlet-name>SimpleUploader</servlet-name>    
  136.   
  137.     <url-pattern>/FCKeditor/editor/filemanager/upload/simpleuploader</url-pattern>    
  138.   
  139.   </servlet-mapping>    

5.在需要调用的页面

先导入:

代码
  1. <%@ taglib uri="http://fckeditor.net/tags-fckeditor" prefix="FCK" %>   

并在需要调用的地方输入:

代码
  1. <form action="jsp2.jsp" method="post">
    <FCK:editor id="content" width="100%" height="320" fontNames="宋体;黑体;隶书;楷体_GB2312;Arial;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana"    
             
                                    imageBrowserURL="/FckTest/FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector"  
          
                                    linkBrowserURL="/FckTest/FCKeditor/editor/filemanager/browser/default/browser.html?Connector=connectors/jsp/connector"  
          
                                    flashBrowserURL="/FckTest/FCKeditor/editor/filemanager/browser/default/browser.html?Type=Flash&Connector=connectors/jsp/connector"  
          
                                    imageUploadURL="/FckTest/FCKeditor/editor/filemanager/upload/simpleuploader?Type=Image"  
          
                                    linkUploadURL="/FckTest/FCKeditor/editor/filemanager/upload/simpleuploader?Type=File"  
          
                                    flashUploadURL="/FckTest/FCKeditor/editor/filemanager/upload/simpleuploader?Type=Flash" >    
    </FCK:editor> 
    <input type="submit" value="aaaaaaaaaaaaaaaaa">
    </form> 

--------------
 
  最后加过滤器

上传文件名乱码,修改SimpleUploaderServlet此类