FCKeditor是sourceforge.net上面的一(yī)個開(kāi)源項目,主要是實現在線網頁編輯器的功能,可以讓web程序擁有如MS Word這樣強大(dà)的編輯功能。官方網站爲http://www.fckeditor.net ,在服務器端支持ASP.Net、ASP、ClodFusion、PHP、Java等語言,并且支持IE 5+、Mozilla 、Netscape等主流浏覽器。
首先在官方網站下(xià)載fckeditor,注意有兩個包,一(yī)個是主文件,一(yī)個是jsp整合包的。
1、解壓FCKeditor_2.2.zip,(FCKeditor主文件),将FCKeditor目錄複制到網站根目錄下(xià),
2、解壓FCKeditor-2.3.zip,(jsp,FCKeditor整合包),作用:This is the JSP Integration Pack for using FCKeditor inside a java server page without the complexity of using a Java scriptlets or the javascript api.
3、将FCKeditor-2.3/web/WEB-INF/web.xml中(zhōng)的兩個servlet,servlet-mapping定義複制到自已項目的web.xml文件中(zhōng)
修改
<servlet-mapping>
<servlet-name>Connector</servlet-name>
<url-pattern>/editor/filemanager/browser/default/connectors/jsp/connector</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>SimpleUploader</servlet-name>
<url-pattern>/editor/filemanager/upload/simpleuploader</url-pattern>
</servlet-mapping>
爲
<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>
4、将FCKeditor-2.3/web/WEB-INF/lib目錄下(xià)文件複制到自已項目的lib文件夾中(zhōng)
5、在需使用FCKeditor的jsp界面中(zhōng)加入:
// 文件開(kāi)頭處加入
<%@ taglib uri="http://fckeditor.net/tags-fckeditor" prefix="FCK" %>
//要使用的地方加入
<FCK:editor id="content" basePath="/FCKeditor/"
imageBrowserURL="/FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector"
linkBrowserURL="/FCKeditor/editor/filemanager/browser/default/browser.html?Connector=connectors/jsp/connector"
flashBrowserURL="/FCKeditor/editor/filemanager/browser/default/browser.html?Type=Flash&Connector=connectors/jsp/connector"
imageUploadURL="/FCKeditor/editor/filemanager/upload/simpleuploader?Type=Image"
linkUploadURL="/FCKeditor/editor/filemanager/upload/simpleuploader?Type=File"
flashUploadURL="/FCKeditor/editor/filemanager/upload/simpleuploader?Type=Flash">
this is default content :)
</FCK:editor>
啓動服務器測試。。。。成功後,來給FCKeditor瘦瘦身.
1、将FCKeditor目錄下(xià)及子目錄下(xià)所有以”_”下(xià)劃線開(kāi)頭的文件夾删除
2.FCKeditor根目錄下(xià)隻保留fckconfig.js, fckeditor.js, fckstyles.xml, fcktemplates.xml其餘全部删除
3.将editor/filemanager/upload目錄下(xià)文件及文件夾清空.
4.還可以将editor/skins目錄下(xià)的皮膚文件删除,隻留下(xià)default一(yī)套皮膚(如果你不需要換皮膚的話(huà))
5.還可以将editor/lang目錄下(xià)文件删除,隻保留en.js, fcklanguagemanager.js, zh-cn.js, zh.js文件(英文,簡體(tǐ)中(zhōng)文,繁體(tǐ)中(zhōng)文一(yī)般應該夠用了:) )
完成,現在看是不是清爽了很多?
其它問題:
在struts+spring+hibernate中(zhōng)使用,上傳圖像功能中(zhōng)可能會出現報:
The output format must have a ‘{http://xml.apache.org/xalan}content-handler’ property!
錯的情況,将WEB-INF/lib目錄下(xià)xalan*.jar删除試試
安全問題:
假如在前台讓普通用戶也能使用FCKEditor,要注意相關安全問題,在前台使用時,不要使用默認的ToolBar,
要将添加圖像,flash,圖像域按鈕去(qù)掉
在fckconfig.js中(zhōng)大(dà)約78行配置 那些數組中(zhōng)的值就像當于界面上的一(yī)個功能,你可以強行把每組值試出來代表什麽。:P
到此安裝FCKeditor就完成了,相關詳細配置你可以看FCKeditor-2.3.zip,(jsp,FCKeditor整合包)文件夾中(zhōng)web/_samples目錄下(xià)的例子。
首先在官方網站下(xià)載fckeditor,注意有兩個包,一(yī)個是主文件,一(yī)個是jsp整合包的。
1、解壓FCKeditor_2.2.zip,(FCKeditor主文件),将FCKeditor目錄複制到網站根目錄下(xià),
2、解壓FCKeditor-2.3.zip,(jsp,FCKeditor整合包),作用:This is the JSP Integration Pack for using FCKeditor inside a java server page without the complexity of using a Java scriptlets or the javascript api.
3、将FCKeditor-2.3/web/WEB-INF/web.xml中(zhōng)的兩個servlet,servlet-mapping定義複制到自已項目的web.xml文件中(zhōng)
修改
<servlet-mapping>
<servlet-name>Connector</servlet-name>
<url-pattern>/editor/filemanager/browser/default/connectors/jsp/connector</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>SimpleUploader</servlet-name>
<url-pattern>/editor/filemanager/upload/simpleuploader</url-pattern>
</servlet-mapping>
爲
<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>
4、将FCKeditor-2.3/web/WEB-INF/lib目錄下(xià)文件複制到自已項目的lib文件夾中(zhōng)
5、在需使用FCKeditor的jsp界面中(zhōng)加入:
// 文件開(kāi)頭處加入
<%@ taglib uri="http://fckeditor.net/tags-fckeditor" prefix="FCK" %>
//要使用的地方加入
<FCK:editor id="content" basePath="/FCKeditor/"
imageBrowserURL="/FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector"
linkBrowserURL="/FCKeditor/editor/filemanager/browser/default/browser.html?Connector=connectors/jsp/connector"
flashBrowserURL="/FCKeditor/editor/filemanager/browser/default/browser.html?Type=Flash&Connector=connectors/jsp/connector"
imageUploadURL="/FCKeditor/editor/filemanager/upload/simpleuploader?Type=Image"
linkUploadURL="/FCKeditor/editor/filemanager/upload/simpleuploader?Type=File"
flashUploadURL="/FCKeditor/editor/filemanager/upload/simpleuploader?Type=Flash">
this is default content :)
</FCK:editor>
啓動服務器測試。。。。成功後,來給FCKeditor瘦瘦身.
1、将FCKeditor目錄下(xià)及子目錄下(xià)所有以”_”下(xià)劃線開(kāi)頭的文件夾删除
2.FCKeditor根目錄下(xià)隻保留fckconfig.js, fckeditor.js, fckstyles.xml, fcktemplates.xml其餘全部删除
3.将editor/filemanager/upload目錄下(xià)文件及文件夾清空.
4.還可以将editor/skins目錄下(xià)的皮膚文件删除,隻留下(xià)default一(yī)套皮膚(如果你不需要換皮膚的話(huà))
5.還可以将editor/lang目錄下(xià)文件删除,隻保留en.js, fcklanguagemanager.js, zh-cn.js, zh.js文件(英文,簡體(tǐ)中(zhōng)文,繁體(tǐ)中(zhōng)文一(yī)般應該夠用了:) )
完成,現在看是不是清爽了很多?
其它問題:
在struts+spring+hibernate中(zhōng)使用,上傳圖像功能中(zhōng)可能會出現報:
The output format must have a ‘{http://xml.apache.org/xalan}content-handler’ property!
錯的情況,将WEB-INF/lib目錄下(xià)xalan*.jar删除試試
安全問題:
假如在前台讓普通用戶也能使用FCKEditor,要注意相關安全問題,在前台使用時,不要使用默認的ToolBar,
要将添加圖像,flash,圖像域按鈕去(qù)掉
在fckconfig.js中(zhōng)大(dà)約78行配置 那些數組中(zhōng)的值就像當于界面上的一(yī)個功能,你可以強行把每組值試出來代表什麽。:P
到此安裝FCKeditor就完成了,相關詳細配置你可以看FCKeditor-2.3.zip,(jsp,FCKeditor整合包)文件夾中(zhōng)web/_samples目錄下(xià)的例子。