在JSP中配置使用fckeditor詳解

來源:互聯網
上載者:User

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

首先在官方網站下載fckeditor,注意有兩個包,一個是主檔案,一個是jsp整合包的。

1、解壓FCKeditor_2.2.zip,(FCKeditor主檔案),將FCKeditor目錄複寫到網站根目錄下,

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定義複製到自已項目的web.xml檔案中

修改:

<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目錄下檔案複製到自已項目的lib檔案夾中

5、在需使用FCKeditor的jsp介面中加入:

// 檔案開頭處加入
<%@ 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>

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.