Configure and use fckeditor in jsp Environment

Source: Internet
Author: User

FCKeditor is an open-source project on sourceforge.net. It mainly implements the online web editor function and enables web programs to have powerful editing functions such as MS Word. Official Website for http://www.fckeditor.net, server support ASP. Net, ASP, ClodFusion, PHP, Java and other languages, and support IE 5 +, Mozilla, Netscape and other mainstream browsers.
First, download fckeditor from the official website. Note that there are two packages: one is the main file and the other is the integration package of jsp (preferred for SUN Enterprise applications.

1. Decompress fckeditor_2.2.zip (main file of FCKeditor) and copy the FCKeditor directory to the root directory of the website,

2. Decompress fckeditor-2.3.zip, (jsp (preferred for SUN Enterprise applications), FCKeditor integration package), role: This is the jsp (preferred for SUN Enterprise applications) 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. the servlet-mapping definition of the two servlets in xml (standardization is getting closer and closer) is copied to the web of your project. xml (standardization is getting closer and closer) files
Modify

<Servlet-mapping>
<Servlet-name> Connector </servlet-name>
<Url-pattern>/editor/filemanager/browser/default/connectors/jsp (preferred for SUN Enterprise Applications)/connector </url-pattern>
</Servlet-mapping>

<Servlet-mapping>
<Servlet-name> SimpleUploader </servlet-name>
<Url-pattern>/editor/filemanager/upload/simpleuploader </url-pattern>
</Servlet-mapping>
Is

<Servlet-mapping>
<Servlet-name> Connector </servlet-name>
<Url-pattern>/FCKeditor/editor/filemanager/browser/default/connectors/jsp (preferred for SUN Enterprise Applications)/connector </url-pattern>
</Servlet-mapping>

<Servlet-mapping>
<Servlet-name> SimpleUploader </servlet-name>
<Url-pattern>/FCKeditor/editor/filemanager/upload/simpleuploader </url-pattern>
</Servlet-mapping>
4. copy the files under the FCKeditor-2.3/web/WEB-INF/lib directory to the lib folder of your project

5. Add:

// Add at the beginning of the file
<% @ Taglib uri = "http://fckeditor.net/tags-fckeditor" prefix = "FCK" %>
// Add the desired location
<FCK: editor id = "content" basePath = "/FCKeditor /"
ImageBrowserURL = "/FCKeditor/editor/filemanager/browser/default/browser.html? Type = Image & Connector = connectors/jsp (preferred for SUN Enterprise Applications)/connector"
LinkBrowserURL = "/FCKeditor/editor/filemanager/browser/default/browser.html? Connector = connectors/jsp (preferred for SUN Enterprise Applications)/connector"
FlashBrowserURL = "/FCKeditor/editor/filemanager/browser/default/browser.html? Type = Flash & Connector = connectors/jsp (preferred for SUN Enterprise Applications)/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>
Start the server test .... After success, the FCKeditor will be reduced.

1. Delete all folders starting with "_" in the FCKeditor directory and subdirectory
2. In the root directory of FCKeditor, only fckconfig. js, fckeditor. js, and fckstyles. xml are retained (standardization is getting closer and closer), and fcktemplates. xml (standardization is getting closer and closer) is deleted.
3. Clear the files and folders in the editor/filemanager/upload directory.
4. You can also delete the skin files under the editor/skins directory, leaving only the default skin (if you do not need to change the skin)
5. you can also delete the files in the editor/lang directory and retain only en. js, fck1_agemanager. js, zh-cn.js, zh. js files (English, simplified Chinese, traditional Chinese should be enough :))

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.