struts2中运用Fckeditor 2.6.5 + fckeditor-java-2.5-bin

struts2中使用Fckeditor 2.6.5 + fckeditor-java-2.5-bin

struts2中使用Fckeditor 2.6.5 +  fckeditor-java-2.5-bin 


下载地址如下: 


Fckeditor 2.6.5 :FCKeditor_2.6.5.zip    


http://sourceforge.net/projects/fckeditor/files/FCKeditor/ 

http://sourceforge.net/projects/fckeditor/files/FCKeditor.Java/2.5/

 

 

相关中文问题和上传路径问题,请看下面的文章

 

Fckeditor 2.6.5 中文问题和fckeditor-java-2.5-bin 文件上传路径动态生成

 

Xml代码  struts2中运用Fckeditor 2.6.5 +  fckeditor-java-2.5-bin
  1. <filter-mapping>  
  2.  <filter-name>struts2</filter-name>  
  3.  <url-pattern>*.action</url-pattern>          
  4.  </filter-mapping>  
  5.  <filter-mapping>  
  6.  <filter-name>struts2</filter-name>  
  7.  <url-pattern>*.jsp</url-pattern>  
  8.  </filter-mapping>  
  9. </filter-mapping>  


//好像这个servlet不配置也可以的

Xml代码  struts2中运用Fckeditor 2.6.5 +  fckeditor-java-2.5-bin
  1. <servlet>  
  2.  <servlet-name>Connector</servlet-name>  
  3.  <servlet-class>net.fckeditor.connector.ConnectorServlet</servlet-class>  
  4.  <load-on-startup>1</load-on-startup>  
  5. </servlet>  
  6. <servlet-mapping>  
  7.  <servlet-name>Connector</servlet-name>  
  8.  <url-pattern>/fckeditor/editor/filemanager/connectors/*</url-pattern>  
  9. </servlet-mapping>  



1)解压主文件,放到项目的WebRoot目录下; 

2)解压fckeditor-java-2.5-bin.zip,从lib中找到commons-fileupload-1.2.1.jar、commons-io-1.3.2.jar、slf4j-api-1.5.8.jar 

给FckEditor瘦身 
      删除fckeditor目录下面所有以“_”开头的文件或者文件夹,像"_samples"、"_documentation.html“等 

     删除fckeditor目录下面除了,fckconfig.js   fckpackage.xml fckstyles.xml   fcktemplates.xml外的所有文件,当然要保留editor文件夹 

     删除fckeditor/editor/lang目录下面除了en.js、 zh-cn.js外的所有文件 

     删除fckeditor\editor\filemanager目录下面的connectors文件夹 

     删除editor\skins目录下面除了default下面的文件夹,这个里面是皮肤,共有三种,可以在fckconfig.js里面设置。 



添加应用: 
在需要应用的jsp页面添加taglib:

Java代码  struts2中运用Fckeditor 2.6.5 +  fckeditor-java-2.5-bin
  1. <%@ taglib uri="http://java.fckeditor.net" prefix="FCK"%>  



然后是引用入编辑框:

Java代码  struts2中运用Fckeditor 2.6.5 +  fckeditor-java-2.5-bin
  1. <FCK:editor instanceName="content" basePath="/FCKeditor" > </FCK:editor>  







注: 
让Struts2仅处理*.action的请求。修改配置文件web.xml: 
将Struts2处理所有web请求的过滤器配置

Xml代码  struts2中运用Fckeditor 2.6.5 +  fckeditor-java-2.5-bin
  1. <filter-mapping>   
  2.               <filter-name>struts2</filter-name>   
  3.               <url-pattern>/*</url-pattern>   
  4.        </filter-mapping>   

改为:仅处理.action或.jsp请求

Xml代码  struts2中运用Fckeditor 2.6.5 +  fckeditor-java-2.5-bin
  1. <filter-mapping>   
  2.               <filter-name>struts2</filter-name>   
  3.               <url-pattern>*.action</url-pattern>   
  4.        </filter-mapping>   
  5.        <filter-mapping>   
  6.               <filter-name>struts2</filter-name>   
  7.               <url-pattern>*.jsp</url-pattern>   
  8.        </filter-mapping>   

备注:以上配置文件的更改会造成Struts2 标签在页面中不显示 
       应该在web.xml文件中加入以下配置:

Xml代码  struts2中运用Fckeditor 2.6.5 +  fckeditor-java-2.5-bin
  1. <filter-mapping>   
  2.               <filter-name>struts2</filter-name>   
  3.               <url-pattern>/struts/*</url-pattern>   
  4. </filter-mapping>  

 

 http://feicer.iteye.com/blog/576209

 

相关中文问题和上传路径问题,请看下面的文章

 

Fckeditor 2.6.5 中文问题和fckeditor-java-2.5-bin 文件上传路径动态生成