fckeditor这么用 我是刚学JAVE WEB,请问下各位高手,fckeditor怎么用啊?然后怎么将fckeditor配置到我要用到的web项目中?要是知道请帮忙告诉我哈,在此不胜感激!QQ:351531104!有兴趣加我多交流交流,一起进步! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <script type="text/javascript" src="fckeditor/fckeditor.js"></script><script type="text/javascript">var oFCKeditor = new FCKeditor('FCKeditor1'); oFCKeditor.BasePath = "/fckeditor/"; oFCKeditor.Create();</script>请看它的文档。http://docs.cksource.com/FCKeditor_2.x/Developers_Guide http://download.csdn.net/source/1820022这个地址是下载如何在asp.net 中使用FCKeditor的 jsp中使用FCKEditor的步骤如下:1.引入FCKEditor的Jar包到项目中。2.添加FCKEditor的标签: <%@ taglib uri="http://fckeditor.net/tags-fckeditor" prefix="fck" %>3.使用标签: <fck:editor id="content" basePath="/Shop/FCKeditor/" skinPath="/Shop/FCKeditor/editor/skins/silver/" width="650" height="400" toolbarSet="Default"> <c:out value="${emailTemplateForm.content}" escapeXml="false"/> </fck:editor> 没法修改自己的发帖啊。LZ搜索一下“传智播客”里面我记得有一个专门讲FCK的视频。可以参考一下 里面不是用smple文件夹么?你把里面的代码随便处理处理就可以用到你的文件了 前段时间刚试验了一下:http://blog.csdn.net/APOLLO_TS/archive/2009/10/26/4727947.aspx 以下是我找的资料,本人已经试过,可行...1.准备工作: 环境:winddows XP、tomcat6.0、JDK1.6 下载: 1):FCKeditor_2.6.4.zip 地址:http://nchc.dl.sourceforge.net/sourc...itor_2.6.4.zip 2):fckeditor-java-2.4.1-bin.zip (JAVA支持包)地址http://nchc.dl.sourceforge.net/sourc...-2.4.1-bin.zip 3)slf4j-1.5.6.zip 地址 :http://slf4j.org/dist/slf4j-1.5.6.zip 2.安装: 下面以jsp为例: 分别解压之后,我们可以得到一个fckeditor和fckeditor-java-2.4.1两个文件夹。fckeditor文件夹下是需要调用的页面和js文件等等,有各种版本,无所谓啦,我们之需要jsp就够了。将文件加全部复制到工程目录下等待调用即可。 注意:有点麻烦的是导包的问题。我们一共需要5个包:commons-fileupload-1.2.1.jar,commons-io- 1.3.2.jar,fckeditor-java-core-2.4.1.jar,slf4j-api-1.5.6.jar,slf4j- simple-1.5.6.jar或slf4j-jdk14-1.5.6.jar。 上面前四个包都可以在fckeditor-java-2.4.1文件夹下面找到,但是第五个却要另外去找,这点我非常不理解,为什么不放在一起。 如果没有的话编译时就会出现如下错误信息: 严重: Servlet /fckeditorDemo threw load() exception java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder 当然版本或许不同,以上的版本是截止2009-02-4的最新版本。如果想要最新版本,可以在slf4j的官网 http://www.slf4j.org/download.html)下到。但是要注意,截止到2009-2-4,slf4j官方最新版本是 1.5.6,但是fckeditor提供的slf4j-api却是1.5.2版本,如果两个版本不一样的话,你将会在控制台看到如下的消息: 严重: Servlet /Java threw load() exception java.lang.IllegalAccessError: tried to access field org.slf4j.impl.StaticLoggerBinder.SINGLETON from class org.slf4j.LoggerFactory 所以千万要注意版本一致问题,上面已经用红色醒目标出了。如果你实在觉得下载很麻烦,那就到这里下载吧: 这是我做了一个例子。 3.配置 1)在共程目录src/下新建一个文件fckeditor.properties,添加内容:connector.userActionImpl=net.fckeditor.requestcycle.impl.UserActionImpl 保存即可。 2)修改web.xml,用来提供上传功能支持, # <servlet> # <servlet-name>Connector</servlet-name> # <servlet-class> # net.fckeditor.connector.ConnectorServlet # </servlet-class> # <load-on-startup>1</load-on-startup> # </servlet> # <servlet-mapping> # <servlet-name>Connector</servlet-name> # <url-pattern> # /fckeditor/editor/filemanager/connectors/* # </url-pattern> # </servlet-mapping> 4.应用 在工程目录WebRoot下新建index.jsp,result.jsp两个文件, index.jsp: 1. <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 2. <%@ taglib uri="http://java.fckeditor.net" prefix="FCK" %> 3. <% 4. String path = request.getContextPath(); 5. String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 6. %> 7. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 8. <html> 9. <head> 10. <base href="<%=basePath%>"> 11. <title>FCKeditor.java2.4 for FCKeditor2.6.3Beate text</title> 12. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 13. <meta http-equiv="pragma" content="no-cache"> 14. <meta http-equiv="cache-control" content="no-cache"> 15. <meta http-equiv="expires" content="0"> 16. <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> 17. <meta http-equiv="description" content="This is my page"> 18. </head> 19. <body> 20. <form action="result.jsp" method="post"> 21. <FCK:editor instanceName="content"> 22. <jsp:attribute name="value"> 23. 您的内容..... 24. </jsp:attribute> 25. </FCK:editor> 26. <input type="submit" value="提交"> 27. </form> 28. 29. </body> 30. </html> result.jsp 1. <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 2. <% 3. String path = request.getContextPath(); 4. String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 5. %> 6. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 7. <html> 8. <head> 9. <base href="<%=basePath%>"> 10. <title>My JSP 'result.jsp' starting page</title> 11. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 12. <meta http-equiv="pragma" content="no-cache"> 13. <meta http-equiv="cache-control" content="no-cache"> 14. <meta http-equiv="expires" content="0"> 15. <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> 16. <meta http-equiv="description" content="This is my page"> 17. </head> 18. <body> 19. <%=request.getParameter("content") %> 20. </body> 21. </html> 在IE地址中输入:http://localhost:8080/FCKtest OK,成功了! 对了,乱码问题没有解决,lz可以再找找相关资料,比较简单,重写下源代码ConnectorServlet.java类中的doPost()和doGet()方法即可... 1):FCKeditor_2.6.4.zip 地址:http://nchc.dl.sourceforge.net/sourc...itor_2.6.4.zip 2):fckeditor-java-2.4.1-bin.zip (JAVA支持包)地址http://nchc.dl.sourceforge.net/sourc...-2.4.1-bin.zip WEB迅雷下载失败 那你用Google下,搜索其他站点的资源... 怎么让火狐浏览器兼容js? servlet和jsp之间的相互调用问题 如何用Eclipse + Tomcat来开发WebGIS,(MapXtreme for java) 一个jsp页面中的flash链接的问题 如何把结果集写成一个txt文件,让客户自己下载下来 git关于秘钥身份确认的请教 <a>标签如何用js判断后不跳转 关于JSP一个问题:<%! 这三个字符开头是什么意思? 100分!jsp中文显示问题。 手机客户端 和 后台实现语音通信 刚接触JSP,请问我要像.NET一样实现下拉框和列表框的结合,怎么实现? javascipt问题:关闭模态对话框,启动新的窗口
<script type="text/javascript" src="fckeditor/fckeditor.js"></script>
<script type="text/javascript">
var oFCKeditor = new FCKeditor('FCKeditor1');
oFCKeditor.BasePath = "/fckeditor/";
oFCKeditor.Create();
</script>请看它的文档。
http://docs.cksource.com/FCKeditor_2.x/Developers_Guide
1.引入FCKEditor的Jar包到项目中。
2.添加FCKEditor的标签:
<%@ taglib uri="http://fckeditor.net/tags-fckeditor" prefix="fck" %>
3.使用标签:
<fck:editor id="content" basePath="/Shop/FCKeditor/" skinPath="/Shop/FCKeditor/editor/skins/silver/" width="650" height="400" toolbarSet="Default"> <c:out value="${emailTemplateForm.content}" escapeXml="false"/>
</fck:editor>
LZ搜索一下“传智播客”里面我记得有一个专门讲FCK的视频。可以参考一下
下载:
1):FCKeditor_2.6.4.zip
地址:http://nchc.dl.sourceforge.net/sourc...itor_2.6.4.zip 2):fckeditor-java-2.4.1-bin.zip (JAVA支持包)地址http://nchc.dl.sourceforge.net/sourc...-2.4.1-bin.zip 3)slf4j-1.5.6.zip 地址 :http://slf4j.org/dist/slf4j-1.5.6.zip 2.安装: 下面以jsp为例: 分别解压之后,我们可以得到一个fckeditor和fckeditor-java-2.4.1两个文件夹。fckeditor文件夹下是需要调用的页面和js文件等等,有各种版本,无所谓啦,我们之需要jsp就够了。将文件加全部复制到工程目录下等待调用即可。
注意:有点麻烦的是导包的问题。我们一共需要5个包:commons-fileupload-1.2.1.jar,commons-io- 1.3.2.jar,fckeditor-java-core-2.4.1.jar,slf4j-api-1.5.6.jar,slf4j- simple-1.5.6.jar或slf4j-jdk14-1.5.6.jar。
上面前四个包都可以在fckeditor-java-2.4.1文件夹下面找到,但是第五个却要另外去找,这点我非常不理解,为什么不放在一起。
如果没有的话编译时就会出现如下错误信息:
严重: Servlet /fckeditorDemo threw load() exception
java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder 当然版本或许不同,以上的版本是截止2009-02-4的最新版本。如果想要最新版本,可以在slf4j的官网 http://www.slf4j.org/download.html)下到。但是要注意,截止到2009-2-4,slf4j官方最新版本是 1.5.6,但是fckeditor提供的slf4j-api却是1.5.2版本,如果两个版本不一样的话,你将会在控制台看到如下的消息: 严重: Servlet /Java threw load() exception
java.lang.IllegalAccessError: tried to access field org.slf4j.impl.StaticLoggerBinder.SINGLETON from class org.slf4j.LoggerFactory 所以千万要注意版本一致问题,上面已经用红色醒目标出了。如果你实在觉得下载很麻烦,那就到这里下载吧: 这是我做了一个例子。 3.配置 1)在共程目录src/下新建一个文件fckeditor.properties,添加内容:connector.userActionImpl=net.fckeditor.requestcycle.impl.UserActionImpl 保存即可。
2)修改web.xml,用来提供上传功能支持, # <servlet>
# <servlet-name>Connector</servlet-name>
# <servlet-class>
# net.fckeditor.connector.ConnectorServlet
# </servlet-class>
# <load-on-startup>1</load-on-startup>
# </servlet>
# <servlet-mapping>
# <servlet-name>Connector</servlet-name>
# <url-pattern>
# /fckeditor/editor/filemanager/connectors/*
# </url-pattern>
# </servlet-mapping>
4.应用
在工程目录WebRoot下新建index.jsp,result.jsp两个文件,
index.jsp:
1. <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
2. <%@ taglib uri="http://java.fckeditor.net" prefix="FCK" %>
3. <%
4. String path = request.getContextPath();
5. String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
6. %>
7. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
8. <html>
9. <head>
10. <base href="<%=basePath%>">
11. <title>FCKeditor.java2.4 for FCKeditor2.6.3Beate text</title>
12. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
13. <meta http-equiv="pragma" content="no-cache">
14. <meta http-equiv="cache-control" content="no-cache">
15. <meta http-equiv="expires" content="0">
16. <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
17. <meta http-equiv="description" content="This is my page">
18. </head>
19. <body>
20. <form action="result.jsp" method="post">
21. <FCK:editor instanceName="content">
22. <jsp:attribute name="value">
23. 您的内容.....
24. </jsp:attribute>
25. </FCK:editor>
26. <input type="submit" value="提交">
27. </form>
28.
29. </body>
30. </html>
result.jsp
1. <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
2. <%
3. String path = request.getContextPath();
4. String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
5. %>
6. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
7. <html>
8. <head>
9. <base href="<%=basePath%>">
10. <title>My JSP 'result.jsp' starting page</title>
11. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
12. <meta http-equiv="pragma" content="no-cache">
13. <meta http-equiv="cache-control" content="no-cache">
14. <meta http-equiv="expires" content="0">
15. <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
16. <meta http-equiv="description" content="This is my page">
17. </head>
18. <body>
19. <%=request.getParameter("content") %>
20. </body>
21. </html>
在IE地址中输入:http://localhost:8080/FCKtest OK,成功了!
地址:http://nchc.dl.sourceforge.net/sourc...itor_2.6.4.zip 2):fckeditor-java-2.4.1-bin.zip (JAVA支持包)地址http://nchc.dl.sourceforge.net/sourc...-2.4.1-bin.zip
WEB迅雷下载失败