使用Fckeditor
来源:互联网 发布:wan端口和lan端口 编辑:程序博客网 时间:2024/05/23 01:14
1、导入相应jar包
2、将fredck.FCKeditor的包放置到对应目录下(src下的cn.itcast)
3、将fckeditor的文件夹复制到WEBRoot下
4、使用FCK的标签,将FCKeditor.tld的标签放置到WEB-INF下
同时修改标签中的内容,要在src的路径下找到该路径:<tag>
<name>editor</name> <tagclass>cn.itcast.fredck.FCKeditor.tags.FCKeditorTag</tagclass> <bodycontent>JSP</bodycontent> <attribute> <name>id</name> <required>true</required> </attribute>
5、在web.xml中添加:路径要正确
<!--liu add FCK文本编辑器start--> <servlet> <servlet-name>Connector</servlet-name> <servlet-class>cn.itcast.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.itcast.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 --> <!-- liu add 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> <!-- end -->
6、修改actingIndex.jsp,将站点运行情况和设备运行情况改成FCK文本编辑器
(1)添加FCK的标签库
<%@ taglib uri="/WEB-INF/FCKeditor.tld" prefix="FCK"%>
(2)添加:
<FCK:editorid="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:editorid="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>上传图片时弹出Error on file upload.Error number:203如附件 error.jpg的错误
原因:fck的servlet被struts2转发了
解决:在web.xml中修改filter-mapping 将
<filter> <filter-name>struts2</filter-name> <filter-class> org.apache.struts2.dispatcher.FilterDispatcher </filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern </filter-mapping> 修改成 <filter> <filter-name>struts2</filter-name> <filter-class> org.apache.struts2.dispatcher.FilterDispatcher </filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>*.do</url-pattern> <url-pattern>*.jsp</url-pattern> </filter-mapping>
0 0
- FCKeditor使用
- FCKEditor 使用
- FCKeditor使用
- 使用Fckeditor
- 最新FCKeditor 精简配置(FCKeditor配置使用)
- Fckeditor的使用--Fckeditor对象的属性
- FCKeditor 配置使用 JS获取FCKeditor内容
- 基于java使用FCKeditor
- FCKeditor的使用
- FCKeditor编辑器使用
- fckeditor 的使用
- FCKeditor使用初步
- 开始使用FCKeditor了
- 基于java使用FCKeditor
- FCKeditor的使用
- FCKeditor使用详解
- FCKeditor编辑器使用
- FCKeditor编辑器使用
- Android Handler 异步消息处理机制 《第一行代码》
- HDU 4612 Warm up(边双连通分量+树的直径)
- PHP几个函数pathinfo()、dirname()、basename()
- centos的chkconfig指令
- 第4周 项目1 - 建立单链表
- 使用Fckeditor
- Java垃圾回收机制2
- asp.net table表格表头及列固定实现
- kafka-客户端c接口
- Objc编程2-类的抽象和构成
- 如何让CentOS服务器磁盘io性能翻倍
- MYSQL的常用函数
- C++中一些有用库函数
- sql处理技巧之--按指定时间粒度汇总数据