javaee项目整合FCKeditor
程序员文章站
2022-05-20 18:45:21
...
FCK整合项目
1、导入相应jar包
2、将fredck.FCKeditor的包放置到对应目录下(src下的业务包下cn.yang)
3、将fckeditor的文件夹复制到WEBRoot下
size]
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>
1、导入相应jar包
2、将fredck.FCKeditor的包放置到对应目录下(src下的业务包下cn.yang)
3、将fckeditor的文件夹复制到WEBRoot下
size]
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——SSH三大框架整合(spring+struts2+hibernate)
-
springboot+springmvc+mybatis项目整合
-
activiti flowable 开源工作流引擎项目整合开发实施实践总结
-
springboot windows10风格 activiti 整合项目框架源码 shiro 安全框架 druid
-
个人网站赚钱项目之付费源码主题整合自动赚钱思路和实践
-
详解android与百度echarts项目整合方法
-
springboot+springmvc+mybatis项目整合
-
springboot activiti 整合项目框架源码 druid 数据库连接池 shiro 安全框架
-
Spring项目整合成SpringBoot的简单登录拦截Demo
-
将angular.js项目整合到.net mvc中的方法详解