Configuring the use of FCKeditor in a JSP environment

Source: Internet
Author: User
Tags copy interface zip root directory
Js

FCKeditor is an open source project above SourceForge.net, which implements the functions of the Online Web page editor, allowing web programs to have powerful editing capabilities such as MS Word. The official website is http://www.fckeditor.net, support asp.net, ASP, clodfusion, PHP, Java and other languages on the server side, and support the mainstream browser such as IE 5+, Mozilla, Netscape.

First in the official website download FCKeditor, note that there are two packages, one is the main file, one is the JSP integration package.

  1 , decompression Fckeditor_2.2.zip, (fckeditor main file), the FCKeditor directory copied to the site root directory,

2 , decompression fckeditor-2.3.zip, (Jsp,fckeditor integration package), function: 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 . Copy two servlet,servlet-mapping definitions from fckeditor-2.3/web/web-inf/web.xml to web.xml files from the project
Modify

<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>

For

<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 . Copy the files in the Fckeditor-2.3/web/web-inf/lib directory to the Lib folder of your own project

  5, in the need to use FCKeditor JSP interface to add:

Add at the beginning of the file
<%@ taglib uri= "Http://fckeditor.net/tags-fckeditor" prefix= "FCK"%>
To use the place to join
<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>

Start Server test .... After success, to give FCKeditor thin body.

  1, the FCKeditor directory and subdirectories under the "_" Underline the folder to delete
2.fckeditor root directory only retains fckconfig.js, Fckeditor.js, Fckstyles.xml, fcktemplates.xml all remaining deleted
3. empty the files and folders in the Editor/filemanager/upload directory.
4. You can also delete the skin files in the Editor/skins directory, leaving only a default set of skin (if you do not need to change the skin)
5. can also be deleted under the Editor/lang directory, only En.js, Fcklanguagemanager.js, Zh-cn.js, zh.js files (English, Simplified Chinese, traditional Chinese should generally be enough:) )

Finished, now look is not refreshing a lot?

  Other questions:
Used in Struts+spring+hibernate, the upload image function may appear in the report:
The output format must have a ' {Http://xml.apache.org/xalan}content-handler ' property!
Wrong situation, will web-inf/lib directory Xalan*.jar Delete try

  Security issues:
If in the foreground lets the ordinary user also can use FCKeditor, must pay attention to the related security question, when uses in the foreground, do not use the default toolbar,
To add images, flash, image field buttons to remove
About 78 rows in Fckconfig.js Configure the values in those arrays as a function on the interface, you can force each set of values to try to represent what. : P

The installation FCKeditor is complete, and the detailed configuration you can look at Fckeditor-2.3.zip, (jsp,fckeditor consolidation Package) folder in the Web/_samples directory example.



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.