试用了一下FCKeditor,根据网上的文章小结一下: 1.下载 FCKeditor.java 2.3 (FCKeditot for java) FCKeditor 2.2 (FCKeditor基本文件)

2.建立项目:tomcat/webapps/TestFCKeditor.

3.将FCKeditor2.2解压缩,将整个目录FCKeditor复制到项目的根目录下, 目录结构为:tomcat/webapps/TestFCKeditor/FCKeditor 然 后将FCKeditor-2.3.zip(java)压缩包中/web/WEB-INF/lib/目录下的两个jar文件拷到项目的/WEB-INF/ lib/目录下。把其中的src目录下的FCKeditor.tld文件copy到TestFCKedit/FCKeitor/WEB-INF/下

4.将FCKeditor-2.3.zip压缩包中/web/WEB-INF/目录下的web.xml文件合并到项目的/WEB-INF/目录下的web.xml文件中。

5. 修改合并后的web.xml文件,将名为SimpleUploader的Servlet的enabled参数值改为true, 以允许上传功能,Connector Servlet的baseDir参数值用于设置上传文件存放的位置。 添加标签定义: <taglib> <taglib-uri>/TestFCKeditor</taglib-uri> <taglib-location>/WEB-INF/FCKeditor.tld</taglib-location> </taglib>

运行图:

6. 上面文件中两个servlet的映射分别为:/editor/filemanager/browser/default/connectors/jsp/connector 和/editor/filemanager/upload/simpleuploader,需要在两个映射前面加上/FCKeditor, 即改为/FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector和 /FCKeditor/editor/filemanager/upload/simpleuploader。

7.进入skin文件夹,如果你想使用fckeditor默认的这种奶黄色, 那就把除了default文件夹外的另两个文件夹直接删除.

8.删除/FCKeditor/目录下除fckconfig.js, fckeditor.js, fckstyles.xml, fcktemplates.xml四个文件以外的所有文件 删除目录/editor/_source, 删除/editor/filemanager/browser/default/connectors/下的所有文件 删除/editor/filemanager/upload/下的所有文件 删除/editor/lang/下的除了fcklanguagemanager.js, en.js, zh.js, zh-cn.js四个文件的所有文件

9.打开/FCKeditor/fckconfig.js 修改 FCKConfig.DefaultLanguage = 'zh-cn' ; 把FCKConfig.LinkBrowserURL等的值替换成以下内容: FCKConfig.LinkBrowserURL = FCKConfig.BasePath + "filemanager/browser/default/browser.html?Connector=connectors/jsp/connector" ; FCKConfig.ImageBrowserURL = FCKConfig.BasePath + "filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector" ; FCKConfig.FlashBrowserURL = FCKConfig.BasePath + "filemanager/browser/default/browser.html?Type=Flash&Connector=connectors/jsp/connector" ;

FCKConfig.LinkUploadURL = FCKConfig.BasePath + 'filemanager/upload/simpleuploader?Type=File' ; FCKConfig.FlashUploadURL = FCKConfig.BasePath + 'filemanager/upload/simpleuploader?Type=Flash' ; FCKConfig.ImageUploadURL = FCKConfig.BasePath + 'filemanager/upload/simpleuploader?Type=Image' ;

10.其它 fckconfig.js总配置文件,可用记录本打开,修改后将文件存为utf-8 编码格式。找到:

FCKConfig.TabSpaces = 0 ; 改为FCKConfig.TabSpaces = 1 ; 即在编辑器域内可以使用Tab键。

如果你的编辑器还用在网站前台的话,比如说用于留言本或是日记回复时,那就不得不考虑安全了, 在前台千万不要使用Default的toolbar,要么自定义一下功能,要么就用系统已经定义好的Basic, 也就是基本的toolbar,找到: FCKConfig.ToolbarSets["Basic"] = [ ['Bold','Italic','-','OrderedList','UnorderedList','-',/*'Link',*/'Unlink','-','Style','FontSize','TextColor','BGColor','-', 'Smiley','SpecialChar','Replace','Preview'] ] ; 这是改过的Basic,把图像功能去掉,把添加链接功能去掉,因为图像和链接和flash和图像按钮添加功能都能让前台 页直接访问和上传文件, fckeditor还支持编辑域内的鼠标右键功能。 FCKConfig.ContextMenu = ['Generic',/*'Link',*/'Anchor',/*'Image',*/'Flash','Select','Textarea','Checkbox','Radio','TextField','HiddenField', /*'ImageButton',*/'Button','BulletedList','NumberedList','TableCell','Table','Form'] ; 这也是改过的把鼠标右键的“链接、图像,FLASH,图像按钮”功能都去掉。

  找到: FCKConfig.FontNames = 'Arial;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana' ; 加上几种我们常用的字体 FCKConfig.FontNames = '宋体;黑体;隶书;楷体_GB2312;Arial;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana' ;

7.添加文件 /TestFCKeditor/test.jsp: <%@ page language="java" import="com.fredck.FCKeditor.*" %> <%@ taglib uri="/TestFCKeditor" prefix="FCK" %> <script type="text/javascript" src="/TestFCKeditor/FCKeditor/fckeditor.js"></script>

<%-- 三种方法调用FCKeditor 1.FCKeditor自定义标签 (必须加头文件 <%@ taglib uri="/TestFCKeditor" prefix="FCK" %> ) 2.script脚本语言调用 (必须引用 脚本文件 <script type="text/javascript" src="/TestFCKeditor/FCKeditor/fckeditor.js"></script> ) 3.FCKeditor API 调用 (必须加头文件 <%@ page language="java" import="com.fredck.FCKeditor.*" %> ) --%> <%-- <form action="show.jsp" method="post" target="_blank"> <FCK:editor id="content" basePath="/TestFCKeditor/FCKeditor/" width="700" height="500" skinPath="/TestFCKeditor/FCKeditor/editor/skins/silver/" toolbarSet = "Default" > input </FCK:editor> <input type="submit" value="Submit"> </form> --%>

<form action="show.jsp" method="post" target="_blank"> <table border="0" width="700"><tr><td> <textarea id="content" name="content" style="WIDTH: 100%; HEIGHT: 400px">input</textarea> <script type="text/javascript"> var oFCKeditor = new FCKeditor('content') ; oFCKeditor.BasePath = "/TestFCKeditor/FCKeditor/" ; oFCKeditor.Height = 400; oFCKeditor.ToolbarSet = "Default" ; oFCKeditor.ReplaceTextarea(); </script> <input type="submit" value="Submit"> </td></tr></table> </form>

<%-- <form action="show.jsp" method="post" target="_blank"> <% FCKeditor oFCKeditor ; oFCKeditor = new FCKeditor( request, "content" ) ; oFCKeditor.setBasePath( "/TestFCKeditor/FCKeditor/" ) ; oFCKeditor.setValue( "input" ); out.println( oFCKeditor.create() ) ; %> <br> <input type="submit" value="Submit"> </form> --%>

添加文件/TestFCKeditor/show.jsp: <% String content = request.getParameter("content"); out.print(content); %>

8.浏览http://localhost:8080/TestFCKeditor/test.jsp ok!

转载于:https://www.cnblogs.com/dainiao01/archive/2008/06/12/2250298.html

FCKeditor在线编辑器的使用相关推荐

  1. ASP.net:添加.net(2.0C#)FCKeditor在线编辑器步骤

    1.下载本版本的编辑器压缩包.源码下载地址 2.解压缩打开文件夹拥有如下文件: 3.在VS中添加"选择项"加载在此文件夹的Bin下FredCK.FCKeditorV2.dll. 4 ...

  2. Asp.net中使用fckeditor在线编辑器配置

    ================= 网上摘录的方法:======================== FCKeditor是目前最好的html文本编辑器,如果还不明白的话看了下图就知道了 效果图: 那么 ...

  3. php在线编辑器fckeditor,[原创]继续给力:PHP中使用FckEditor在线编辑器详解

    最近发现不少学生纷纷给我写邮件,问到老师如何才能实现像学生大本营发表笔记时侯的输入文本框,既可以输入我们想输入的内容又可以直接粘贴其他网站的内容,并且保持格式不能发生变化... 还有同学居然提到,老师 ...

  4. FCKeditor在线文本编辑器初级应用

    2019独角兽企业重金招聘Python工程师标准>>> 首先从FCKeditor的官网( http://www.fckeditor.net/)下载该编辑器,我下载的版本是FCKedi ...

  5. FCKeditor 2.0在线编辑器的设置与修改以及使用

    对于一个全新的网站,FCKeditor就可以直接拿过来用了,不需要进行什么修改.但是对于绝大多数的已有网站而言,FCKeditor的一些设置并不适合自己的使用,这篇文章旨在告诉你简单的修改FCKedi ...

  6. FCKeditor WEB在线编辑器配置手册

    fckeditor精简之道    1.临时文件及文件夹删除:从根目录下开始删除一切以"_"开头的文件及文件夹,因为他们为临时文件和文件夹.删除这类临时文件及文件夹之后,我们还要删除 ...

  7. 基于ThinkPHP的在线编辑器调用

    开源的在线编辑器有很多,比如FCKEditor,UEditor,Kindeditor等,调用方式也都大同小异 下面列举UEditor在线编辑器插件在ThinkPHP里面的应用 1.Ueditor下载地 ...

  8. 05传智_jbpm与OA项目_部门模块中增加部门的jsp页面增加一个在线编辑器功能

    这篇文章讲的是在线编辑器功能,之前的部门模块中,增加部门的功能jsp页面起先是这么做的. 加入在线编辑器之后要达到的效果是: 采用一个插件,名为FCKeditor-v2.6.3.要理解一个插件,要先从 ...

  9. 几种适合开发用的在线编辑器-推荐及下载

    1,FCKeditor 编辑器 最新版本: 2.3.1 站点:http://www.fckeditor.net/ 演示:http://www.fckeditor.net/demo 特点:开源.免费 F ...

最新文章

  1. aaaaaaaaaaa
  2. TCP/IP详解--学习笔记(3)-IP协议,ARP协议,RARP协议
  3. 电脑快捷键横屏变竖屏,电脑显示器竖屏横屏来回切换怎么设置
  4. spring框架 AOP核心详解
  5. openwrt 替换Dropbear by openssh-server
  6. python从入门到实践15章的几个自己的小程序
  7. linux获取笔记本摄像头视频,如何在windows下用ffmpeg抓取笔记本电脑摄像头视频
  8. 什么是 “马太效应” ?
  9. php mssql扩展SQL查询中文字段名解决方法
  10. C#中将字符串中某字符不区分大小写并按全字匹配替换为空
  11. 小程序-云开发-实现微信云支付功能
  12. 读书笔记(SRE:Google运维解密):第22章 处理连锁故障
  13. 史上第一个虫洞,被谷歌量子计算机造出来了 | Nature封面
  14. 全球与中国汽车线性稳压器市场运营状况及未来前景展望报告2022-2028年版
  15. 为什么寄存器处理数据的速度比内存快?
  16. 声网sdk android接入,声网 SDK 接入以及音视频通话应用开发指南
  17. c语言模拟洛伦兹吸引子,洛伦兹吸引子相图的简易实现.pdf
  18. 使用StrongSwan配置IPSec
  19. 在华大半导体的M0+内核HC32L136上移植freertos
  20. 关于MongoDB使用的优化总结

热门文章

  1. mysql jdbc官方,mysql_jdbc
  2. 系统学习深度学习(二十七)--CTC
  3. 图像局部特征(十二)--BRISK特征
  4. JWT 教程_1 SpringBoot与JWT整合
  5. Redis入门到入土教程_2 远程连接redis
  6. android okhttp+解析json( okhttp 工具类)
  7. 计算机学硕考研复试编程能力,苏州大学计算机学硕专业考研复试真题
  8. idea里注释日期怎么_IDEA对类生成注释以及自己定义代码生成方式
  9. 计算机电竞方向,关于电竞专业的就业方向
  10. 分布式数据库的最新发展情况