基于java使用FCKeditor
来源:互联网 发布:八大网络虚拟人物有谁 编辑:程序博客网 时间:2024/05/17 02:38
基于java使用FCKeditor:
试用了一下FCKeditor,感觉不错(http://www.fckeditor.net)
稍稍整理了一下,过程如下:
1.下载
FCKeditor.java 2.3 (FCKeditot for java)
FCKeditor 2.2 (FCKeditor基本文件)
2.建立项目:tomcat/webapps/FCKeditor
3.FCKeditor.java 2.3解压后,把其中的web目录下的WEB-INF目录copy到FCKeditor下(里面有commons-fileupload.jar,FCKeditor-2.3.jar,web.xml等几个文件), 把其中的src目录下的FCKeditor.tld文件copy到FCKeitor/WEB-INF/下
4.修改web.xml:
把SimpleUploader中的配置属性enabled定义为true(开启文件上传功能)
添加标签定义:
<taglib>
<taglib-uri>/FCKeditor</taglib-uri>
<taglib-location>/WEB-INF/FCKeditor.tld</taglib-location>
</taglib>
5.解压FCKeditor2.2后,把目录/editor和fckconfig.js, fckeditor.js, fckstyles.xml, fcktemplates.xml四个文件copy到/FCKeditor下
删除目录/editor/_source,
删除/editor/filemanager/browser/default/connectors/下的所有文件
删除/editor/filemanager/upload/下的所有文件
删除/editor/lang/下的除了fcklanguagemanager.js, en.js, zh.js, zh-cn.js四个文件的所有文件
6.打开/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' ;
7.添加文件 /FCKeditor/test.jsp:
<%@ page language="java" import="com.fredck.FCKeditor.*" %>
<%@ taglib uri="/FCKeditor" prefix="FCK" %>
<script type="text/javascript" src="/FCKeditor/fckeditor.js"></script>
<%--
三种方法调用FCKeditor
1.FCKeditor自定义标签 (必须加头文件 <%@ taglib uri="/FCKeditor" prefix="FCK" %> )
2.script脚本语言调用 (必须引用 脚本文件 <script type="text/javascript" src="/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="/FCKeditor/"
width="700"
height="500"
skinPath="/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 = "/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( "/FCKeditor/" ) ;
oFCKeditor.setValue( "input" );
out.println( oFCKeditor.create() ) ;
%>
<br>
<input type="submit" value="Submit">
</form>
--%>
添加文件/FCKeditor/show.jsp:
<%
String content = request.getParameter("content");
out.print(content);
%>
8.浏览http://localhost:8080/FCKeditor/test.jsp
ok!
9.上传遇到错误: internal server error 500,
直接引用servlet(com.fredck.FCKeditor.connector.ConnectorServlet)也遇到错误: "Provider org.apache.xalan.processor.TransformerFactoryImpl not found",
拷贝xalan.jar到lib目录就可以了
- 基于java使用FCKeditor
- 基于java使用FCKeditor
- 基于java使用FCKeditor
- 基于.net使用FCKeditor
- JAVA中的Fckeditor使用
- Fckeditor的Java使用
- java 使用FCKeditor的步骤
- FCKeditor 2.6.4 在java中使用
- 在线文本编辑器FCKEditor java中的使用
- Java/jsp中集成FCKeditor使用
- 【java】fckeditor在线编辑器的使用
- FCKeditor使用
- FCKEditor 使用
- FCKeditor使用
- 使用Fckeditor
- fckeditor &&java
- FCKeditor在java web程序中的使用介绍
- FCKeditor编辑器在JAVA中的使用与配置
- 一张图片
- Linux不是Windows
- 各种格式文件转换成word文件的方法
- 又一张图片
- 这次是好几张图片
- 基于java使用FCKeditor
- 读“袁峰的红包”有感
- Asp.net 如何实现简体到繁体的转换
- 深入了解异步套接字
- 深入了解异步套接字
- 眼淚盒子
- 大侠宝典 :ORACLE 常用第三方软件介绍
- C# 与 Excel
- 反对郎咸平是容易的,但驳倒郎咸平是不可能的