文章轉(zhuǎn)自:http://hi.baidu.com/huqiwen/blog/item/7d36b15113fddd1e377abe7d.html
==============
由于FckEditor for java 2.4相對于2.3而言做了許多改變,這些改變使得我們的Fckeditor配置起來更方便。例如:
基礎包名從:com.fredck.FCKeditor 改為 net.fckeditor.
文件上傳 SimpleUploaderServle整合到了ConnectorServlet里面,WEB,XML的配置就簡單多了,下面通過一個實例說明配置詳細步驟:
1、首先登陸www.fckeditor.net/download下載FCKeditor的最新版本,需要下載2個壓縮包,一個是基本應用。另一個是在為在jsp下所準備的配置。
最新版本為:FckEditor2.6.3和FckEditor for java 2.4
FCKeditor 2.6.3下載地址:sourceforge.net/project/downloading.php?????
?????? 具體下載地址:http://easynews.dl.sourceforge.net/sourceforge/fckeditor/FCKeditor_2.6.3.zip
FCKeditor for Java 下載地址:sourceforge.net/project/downloading.php
具體下載地址:http://switch.dl.sourceforge.net/sourceforge/fckeditor/fckeditor-java-2.4.1-bin.zip(發(fā)行版,如果需要源碼或者demo包請另行下載)
請下載demo包,否則會出現(xiàn)留言中那位朋友的錯誤!
下載之后分別為:FCKeditor_2.6.3.zip 和 fckeditor-java-2.4.1-bin.zip(fckeditor-java-demo-2.4.1.war)將它們分別解壓。
2、首先在MyEclipse(或者其他的IDE)下建立一個新項目例如:fckeditDemo即http://localhost:8080/fckeditDemo
現(xiàn)在將解壓后的FCKeditor_2.6.3.zip 里面的fckeditor文件夾拷貝到當前的項目文件夾里面。
引入fckeditor的六個包:
我的fckeditor項目目錄結(jié)構(gòu)如下:
3、配置web.xml。配置文件如下,這就是全部了,其他的不需要再配置,由于SimpleUploaderServle整合到了ConnectorServlet里面,所以 文件上傳 等都不需要再配置。
4、在src目錄下面建立fckeditor.properties資源文件,在里面寫入這么一行connector.userActionImpl=net.fckeditor.requestcycle.impl.UserActionImpl
5、下面寫測試頁面:
顯示數(shù)據(jù)的頁面:
6、給FckEditor瘦身
????? 刪除fckeditor目錄下面所有以“_”開頭的文件或者文件夾,像"_samples"、"_documentation.html“等
???? 刪除fckeditor目錄下面除了,fckconfig.js?? fckpackage.xml fckstyles.xml?? fcktemplates.xml外的所有文件,當然要保留editor文件夾
???? 刪除fckeditor/editor/lang目錄下面除了en.js、 zh-cn.js外的所有文件
???? 刪除fckeditor\editor\filemanager目錄下面的connectors文件夾
???? 刪除editor\skins目錄下面除了default下面的文件夾,這個里面是皮膚,共有三種,可以在fckconfig.js里面設置。
PS:有關(guān)中文亂碼問題請參考:http://hi.baidu.com/huqiwen/blog/item/c709aa18fa187a0135fa4103.html
==============
由于FckEditor for java 2.4相對于2.3而言做了許多改變,這些改變使得我們的Fckeditor配置起來更方便。例如:
基礎包名從:com.fredck.FCKeditor 改為 net.fckeditor.
文件上傳 SimpleUploaderServle整合到了ConnectorServlet里面,WEB,XML的配置就簡單多了,下面通過一個實例說明配置詳細步驟:
1、首先登陸www.fckeditor.net/download下載FCKeditor的最新版本,需要下載2個壓縮包,一個是基本應用。另一個是在為在jsp下所準備的配置。
最新版本為:FckEditor2.6.3和FckEditor for java 2.4
FCKeditor 2.6.3下載地址:sourceforge.net/project/downloading.php?????
?????? 具體下載地址:http://easynews.dl.sourceforge.net/sourceforge/fckeditor/FCKeditor_2.6.3.zip
FCKeditor for Java 下載地址:sourceforge.net/project/downloading.php
具體下載地址:http://switch.dl.sourceforge.net/sourceforge/fckeditor/fckeditor-java-2.4.1-bin.zip(發(fā)行版,如果需要源碼或者demo包請另行下載)
請下載demo包,否則會出現(xiàn)留言中那位朋友的錯誤!
下載之后分別為:FCKeditor_2.6.3.zip 和 fckeditor-java-2.4.1-bin.zip(fckeditor-java-demo-2.4.1.war)將它們分別解壓。
2、首先在MyEclipse(或者其他的IDE)下建立一個新項目例如:fckeditDemo即http://localhost:8080/fckeditDemo
現(xiàn)在將解壓后的FCKeditor_2.6.3.zip 里面的fckeditor文件夾拷貝到當前的項目文件夾里面。
引入fckeditor的六個包:

我的fckeditor項目目錄結(jié)構(gòu)如下:

3、配置web.xml。配置文件如下,這就是全部了,其他的不需要再配置,由于SimpleUploaderServle整合到了ConnectorServlet里面,所以 文件上傳 等都不需要再配置。
<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、在src目錄下面建立fckeditor.properties資源文件,在里面寫入這么一行connector.userActionImpl=net.fckeditor.requestcycle.impl.UserActionImpl
5、下面寫測試頁面:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <%@ taglib uri="http://java.fckeditor.net" prefix="FCK" %> <html> <head> <title>FckEditor測試</title> </head> <body style="text-align: center;"> <div style="text-align: center;width: 600pt"> <h2>FckEditor測試</h2> <hr> <form action="ShowData.jsp" method="post"> <FCK:editor instanceName="test" height="400pt"> <jsp:attribute name="value"> 這里是<a >數(shù)據(jù)測試</a> </jsp:attribute> </FCK:editor> <input type="submit" value="提交"/> <input type="reset" value="重置"/> </form> </div> </body> </html>
顯示數(shù)據(jù)的頁面:
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <head> <title>FCKeditor - 顯示數(shù)據(jù)</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <% request.setCharacterEncoding("UTF-8"); String data = request.getParameter("test"); %> <body> <h1>FCKeditor - 顯示數(shù)據(jù)</h1> <hr/><br /> <%=data%> </body> </html>
6、給FckEditor瘦身
????? 刪除fckeditor目錄下面所有以“_”開頭的文件或者文件夾,像"_samples"、"_documentation.html“等
???? 刪除fckeditor目錄下面除了,fckconfig.js?? fckpackage.xml fckstyles.xml?? fcktemplates.xml外的所有文件,當然要保留editor文件夾
???? 刪除fckeditor/editor/lang目錄下面除了en.js、 zh-cn.js外的所有文件
???? 刪除fckeditor\editor\filemanager目錄下面的connectors文件夾
???? 刪除editor\skins目錄下面除了default下面的文件夾,這個里面是皮膚,共有三種,可以在fckconfig.js里面設置。
PS:有關(guān)中文亂碼問題請參考:http://hi.baidu.com/huqiwen/blog/item/c709aa18fa187a0135fa4103.html
更多文章、技術(shù)交流、商務合作、聯(lián)系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號聯(lián)系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元
