欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

javaee项目整合FCKeditor

程序员文章站 2022-05-20 18:45:21
...
FCK整合项目
1、导入相应jar包
javaee项目整合FCKeditor
            
    
    博客分类: javaee fckeditor 
2、将fredck.FCKeditor的包放置到对应目录下(src下的业务包下cn.yang)
javaee项目整合FCKeditor
            
    
    博客分类: javaee fckeditor 
3、将fckeditor的文件夹复制到WEBRoot下
size]javaee项目整合FCKeditor
            
    
    博客分类: javaee fckeditor 
4、使用FCK的标签,将FCKeditor.tld的标签放置到WEB-INF下,同时修改标签中的内容,要在src的路径下找到该路径:<tag>
<name>editor</name>
<tagclass>cn.yang.fredck.FCKeditor.tags.FCKeditorTag</tagclass>
<bodycontent>JSP</bodycontent>
<attribute>
     <name>id</name>
     <required>true</required>
</attribute>
5、在web.xml中添加:路径要正确
   <!-- FCK文本编辑器 start-->
<servlet>
  <servlet-name>Connector</servlet-name>
  <servlet- class>cn.yang.fredck.FCKeditor.connector.ConnectorServlet</servlet-class>
<init-param>
<param-name>baseDir</param-name>
<param-value>/UserFiles/</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
  </servlet>

<servlet>
<servlet-name>SimpleUploader</servlet-name>
<servlet-class>cn.yang.fredck.FCKeditor.uploader.SimpleUploaderServlet</servlet-class>
<init-param>
<param-name>baseDir</param-name>
<param-value>/UserFiles/</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>enabled</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>AllowedExtensionsFile</param-name>
<param-value></param-value>
</init-param>
<init-param>
<param-name>DeniedExtensionsFile</param-name>
<param-value>php|php3|php5|phtml|asp|aspx|ascx|jsp|cfm|cfc|pl|bat|exe|dll|reg|cgi</param-value>
</init-param>
<init-param>
<param-name>AllowedExtensionsImage</param-name>
<param-value>jpg|gif|jpeg|png|bmp</param-value>
</init-param>
<init-param>
<param-name>DeniedExtensionsImage</param-name>
<param-value></param-value>
</init-param>
<init-param>
<param-name>AllowedExtensionsFlash</param-name>
<param-value>swf|fla</param-value>
</init-param>
<init-param>
<param-name>DeniedExtensionsFlash</param-name>
<param-value></param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- end -->

<!-- FCK文本编辑器 start -->
<servlet-mapping>
    <servlet-name>Connector</servlet-name>
    <url-pattern>/fckeditor/editor/filemanager/browser/default/connectors/jsp/connector</url-pattern>
  </servlet-mapping>
 
<servlet-mapping>
    <servlet-name>SimpleUploader</servlet-name>
    <url-pattern>/fckeditor/editor/filemanager/upload/simpleuploader</url-pattern>
  </servlet-mapping>
6、修改对应jsp:test.jsp,将站点运行情况和设备运行情况改成FCK文本编辑器
   (1)添加FCK的标签库
   (2)添加:
        <FCK:editor id="stationRun"  basePath="${pageContext.request.contextPath }/fckeditor/" height="300"
 
               toolbarSet="Basic"
 
               imageBrowserURL="${pageContext.request.contextPath }/fckeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector"
  
               linkBrowserURL="${pageContext.request.contextPath }/fckeditor/editor/filemanager/browser/default/browser.html?Connector=connectors/jsp/connector">
         
          </FCK:editor>

       <FCK:editor id="devRun"  basePath="${pageContext.request.contextPath }/fckeditor/" height="300"
 
               toolbarSet="Basic"
 
               imageBrowserURL="${pageContext.request.contextPath }/fckeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector"
  
               linkBrowserURL="${pageContext.request.contextPath }/fckeditor/editor/filemanager/browser/default/browser.html?Connector=connectors/jsp/connector">
         
          </FCK:editor> 7. 如果struts2中使用FCK,此时要将/*改成对应的连接
  <filter>
  <filter-name>struts2</filter-name>
  <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
  </filter>
  <filter-mapping>
  <filter-name>struts2</filter-name>
  <url-pattern>*.do</url-pattern>
  <url-pattern>*.jsp</url-pattern>
  </filter-mapping>
  • javaee项目整合FCKeditor
            
    
    博客分类: javaee fckeditor 
  • 大小: 2.4 KB
  • javaee项目整合FCKeditor
            
    
    博客分类: javaee fckeditor 
  • 大小: 4.9 KB
  • javaee项目整合FCKeditor
            
    
    博客分类: javaee fckeditor 
  • 大小: 22.3 KB
相关标签: fckeditor