自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

JSP使用FCKeditor詳解

開發(fā) 后端
這里介紹JSP使用FCKeditor,F(xiàn)CKeditor是sourceforge.net上面的一個開源項目,主要是實現(xiàn)在線網(wǎng)頁編輯器的功能,可以讓web程序擁有如MS Word這樣強大的編輯功能。

在向大家詳細介紹JSP使用FCKeditor之前,首先讓大家了解下FCKeditor是什么,然后全面介紹JSP使用FCKeditor。

FCKeditor是sourceforge.net上面的一個開源項目,主要是實現(xiàn)在線網(wǎng)頁編輯器的功能,可以讓web程序擁有如MS Word這樣強大的編輯功能。官方網(wǎng)站為http://www.fckeditor.net,在服務(wù)器端支持ASP.Net、ASP、ClodFusion、PHP、Java等語言,并且支持IE 5+、Mozilla 、Netscape等主流瀏覽器。

首先在官方網(wǎng)站下載Fckeditor,注意有兩個包,一個是主文件,一個是JSP整合包的。

1、解壓FCKeditor_2.2.zip,(FCKeditor主文件),將FCKeditor目錄復(fù)制到網(wǎng)站根目錄下,

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中的兩個servlet,servlet-mapping定義復(fù)制到自已項目的web.xml文件中,修改

  1. <servlet-mapping>   
  2. <servlet-name>Connector</servlet-name>   
  3. <url-pattern>/editor/filemanager/browser/default/connectors/jsp/connector
  4. </url-pattern>   
  5. </servlet-mapping>   
  6.  
  7. <servlet-mapping>   
  8. <servlet-name>SimpleUploader</servlet-name>   
  9. <url-pattern>/editor/filemanager/upload/simpleuploader</url-pattern> 
  10. </servlet-mapping>  

  1. <servlet-mapping>   
  2. <servlet-name>Connector</servlet-name>   
  3. <url-pattern>/FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector
    </url-pattern>   
  4. </servlet-mapping>   
  5.  
  6. <servlet-mapping>   
  7. <servlet-name>SimpleUploader</servlet-name>   
  8. <url-pattern>/FCKeditor/editor/filemanager/upload/simpleuploader</url-pattern> 
  9. </servlet-mapping>  

4、將FCKeditor-2.3/web/WEB-INF/lib目錄下文件復(fù)制到自已項目的lib文件夾中

5、在需JSP使用FCKeditor的界面中加入:

  1. // 文件開頭處加入   
  2. <%@ taglib uri="http://fckeditor.net/tags-fckeditor" prefix="FCK" %>   
  3. //要使用的地方加入   
  4. <FCK:editor id="content" basePath="/FCKeditor/"   
  5. imageBrowserURL="/FCKeditor/editor/filemanager/browser/default/browser.html?
    Type=Image&Connector=connectors/jsp/connector"
       
  6. linkBrowserURL="/FCKeditor/editor/filemanager/browser/default/browser.html?
    Connector=connectors/jsp/connector"
       
  7. flashBrowserURL="/FCKeditor/editor/filemanager/browser/default/browser.html?
    Type=Flash&Connector=connectors/jsp/connector"
       
  8. imageUploadURL="/FCKeditor/editor/filemanager/upload/simpleuploader?Type=Image"   
  9. linkUploadURL="/FCKeditor/editor/filemanager/upload/simpleuploader?Type=File"   
  10. flashUploadURL="/FCKeditor/editor/filemanager/upload/simpleuploader?Type=Flash">   
  11. this is default content :)   
  12. </FCK:editor>  

啟動服務(wù)器測試。。。。成功后,來給FCKeditor瘦瘦身.
1.將FCKeditor目錄下及子目錄下所有以”_”下劃線開頭的文件夾刪除
2.FCKeditor根目錄下只保留fckconfig.js, fckeditor.js, fckstyles.xml, fcktemplates.xml其余全部刪除
3.將editor/filemanager/upload目錄下文件及文件夾清空.
4.還可以將editor/skins目錄下的皮膚文件刪除,只留下default一套皮膚(如果你不需要換皮膚的話)
5.還可以將editor/lang目錄下文件刪除,只保留en.js, fcklanguagemanager.js, zh-cn.js, zh.js文件(英文,簡體中文,繁體中文一般應(yīng)該夠用了:) )

完成,現(xiàn)在看是不是清爽了很多?

其它問題:

在struts+spring+hibernate中使用,上傳圖像功能中可能會出現(xiàn)報:The output format must have a '{http://xml.apache.org/xalan}content-handler' property!錯的情況,將WEB-INF/lib目錄下xalan*.jar刪除試試

安全問題:

假如在前臺讓普通用戶也能JSP使用FCKeditor,要注意相關(guān)安全問題,在前臺使用時,不要使用默認的ToolBar,
要將添加圖像,flash,圖像域按鈕去掉
在fckconfig.js中大約78行配置  那些數(shù)組中的值就像當于界面上的一個功能,你可以強行把每組值試出來代表什么。

到此安裝FCKeditor就完成了,相關(guān)詳細配置你可以看FCKeditor-2.3.zip,(JSP,FCKeditor整合包)文件夾中web/_samples目錄下的例子。

【編輯推薦】

  1. JSP和BEAN詳細剖析
  2. 帶參數(shù)方法調(diào)用JSP EL表達式
  3. JSP和JavaBean模型詳細介紹
  4. 詳解JSP開發(fā)環(huán)境的配置
  5. Servlet和JSP經(jīng)驗總結(jié)
責任編輯:佚名 來源: Infoq
相關(guān)推薦

2009-02-25 10:55:29

FCKeditor控件JSP

2009-06-30 10:59:38

fckeditorJSP

2009-02-26 08:54:50

FCKeditorHTML編輯器

2009-06-23 09:33:20

FCKEditorJSFJSP

2009-02-11 10:08:53

Cookie屬性JSP

2009-07-06 17:08:19

測試JSP容器

2009-06-29 17:57:30

ApplicationJSP

2009-07-03 17:33:06

JSP中調(diào)用JavaB

2009-07-02 13:10:09

JSP技術(shù)

2009-07-06 10:00:31

JSP頁面?zhèn)髦?/a>

2009-07-06 15:03:53

JSP向Servlet

2009-07-21 13:43:53

ASP和JSP比較

2009-07-06 17:07:11

JSP實例

2009-07-01 18:17:32

JSP處理Cookie

2009-07-06 09:49:26

Servlet JSP

2009-02-01 10:04:44

JSPJavaBeanJavaBean應(yīng)用

2009-08-03 10:11:44

JSP開發(fā)環(huán)境配置

2009-07-02 11:34:42

JSP指令JSP開發(fā)

2009-06-06 18:43:34

JSP Action

2009-07-06 18:02:34

JSP服務(wù)器
點贊
收藏

51CTO技術(shù)棧公眾號