FCKeditor控件的使用
来源:互联网 发布:淘宝店铺广告 编辑:程序博客网 时间:2024/06/09 18:17
在这里在前人的基础和自己使用的过程中遇到的问题做一下总结:
FCKeditor是sourceforge.net上面的一个开源项目,主要是实现在线网页编辑器的功能,可以让web程序拥有如MSWord这样强大的编辑功能。官方网站为http://www.fckeditor.net,在服务器端支持ASP.Net、ASP、ClodFusion、PHP、Java等语言,并且支持IE 5+、Mozilla、Netscape等主流浏览器。
首先来看一下我是用FCKEditor后的项目的目录:
首先在官方网站下载fckeditor,注意有两个包,一个是主文件,一个是jsp整合包的。
1、解压FCKeditor_2.4.2.zip,(FCKeditor主文件),将FCKeditor目录复制到网站根目录下,
2、解压FCKeditor-2.3.zip,(jsp,FCKeditor整合包),作用:This is the JSPIntegration Pack for using FCKeditor inside a java server page withoutthe complexity of using a Java scriptlets or the javascript api.
3、将FCKeditor-2.3/web/WEB-INF/web.xml中的两个servlet,servlet-mapping定义复制到自已项目的web.xml文件中并修改
修改结果:
<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>
在这里要强调一下,红色部分为你第1步解压后得到的那个文件夹名称
然后加入如下内容
<taglib>
<taglib-uri>/FCKeditor</taglib-uri>
<taglib-location>/WEB-INF/FCKeditor.tld</taglib-location>
</taglib>
在这里也要强调一下,有的人使用的时候这里会不能识别taglib,那是因为serlvet版本不同导致的,我用的是servlet2.5版本,所以需要应该这样写:
<jsp-config>
<taglib>
<taglib-uri>/FCKeditor</taglib-uri>
<taglib-location>/WEB-INF/FCKeditor.tld</taglib-location>
</taglib>
</jsp-config>
以下是查看tomcat容器中jsp和servlet版本的方法:
找到jsp-api.jar和servlet-api.jar两个jar包,分别用winrar这类的软件打开,里面的META-INF文件夹下的MANIFEST.MF文件,里面有相应的版本号
jsp是2.1,servlet是2.5
4、然后我们将FCKeditor-2.3/web/WEB-INF/lib中的两个jar包拷贝到你项目的WEB-INF/lib目录下,将FCKeditor-2.3/src下的FCKeditor.tld拷贝到/你项目的WEB-INF下。
5、在需使用FCKeditor的jsp界面中加入:
// 文件开头处加入
<%@ taglib uri="/FCKeditor
" prefix="FCK" %>
这里红色对应的就是上面绿色字体,可能在jsp中会报找不到这个uri,如果你是按照我上面一步步来的,那么不用担心,只是jsp暂时识别不了,多重开几次就行了
注意这里的URL是为了找到WebRoot目录下的FCKeditor文件夹,因为我的jsp使用了
也就是使用了绝对路径,所以我可以像上面一样写,你做的话可以自己定义
启动服务器测试…成功后,来给FCKeditor瘦瘦身.
1、将FCKeditor目录下及子目录下所有以”_”下划线开头的文件夹删除
2.FCKeditor根目录下只保留fckconfig.js, fckeditor.js, fckstyles.xml, fcktemplates.xml其余全部删除
3.将editor/filemanager/upload目录下文件及文件夹清空.
4.还可以将editor/skins目录下的皮肤文件删除,只留下default一套皮肤(如果你不需要换皮肤的话
5.还可以将editor/lang目录下文件删除,只保留en.js, fcklanguagemanager.js, zh-cn.js, zh.js文件(英文,简体中文,繁体中文一般应该够用了:) )
其它问题:
在struts+spring+hibernate中使用,上传图像功能中可能会出现报:
The output format must have a ‘{http://xml.apache.org/xalan}content-handler’ property!
错的情况,将WEB-INF/lib目录下xalan*.jar删除试试
安全问题:
假如在前台让普通用户也能使用FCKEditor,要注意相关安全问题,在前台使用时,不要使用默认的ToolBar,要将添加图
像,flash,图像域按钮去掉,在fckconfig.js中大约78行配置那些数组中的值就像当于界面上的一个功能,你可以强行把每组值试出来代表什
么。
到此安装FCKeditor就完成了,相关详细配置你可以看FCKeditor-2.3.zip,(jsp,FCKeditor整合包)文件夹中web/_samples目录下的例子。
包的下载地址http://luyao123127.javaeye.com/blog/683773
- FCKeditor控件的使用
- FCKEditor控件的配置使用
- JSP使用FCKeditor控件
- 最近使用Fckeditor控件 也只能说简单的使用
- Jsp页面中使用fckeditor控件的两种方法
- Fckeditor控件的引用方法
- Fckeditor的使用--Fckeditor对象的属性
- FCKeditor的使用
- fckeditor 的使用
- FCKeditor的使用
- FCKeditor编辑器的使用
- FCKeditor的使用
- FCKEditor 的使用
- FCKEditor的使用
- FCKeditor的使用
- FCKeditor的使用
- FCKeditor的使用
- fckeditor的使用
- SQL对Xml字段的操作
- silverlight实现不同类型窗体间随意传值
- 采用 spark textArea linkElement spanElement 实现聊天窗口的功能
- XML配置属性中文介绍
- 《GOF设计模式》—享元(FLYWEIGHT)—Delphi源码示例:文档编辑器
- FCKeditor控件的使用
- Oracle的schema、方案、模式、用户
- python ElementTree 基本读操作示例
- metapost的windows批处理命令
- memcached一致性哈希的php类
- The import javax.servlet.http.HttpServletRequest cannot be resolved
- 多memcached 和 mysql 主从 环境下PHP开发
- MySQL常用命令
- 交叉编译场景分析(arm-linux)(一)--基本知识