Current location - Health Preservation Learning Network - Slimming men and women - Configuring and using FCKEditor in jsp environment
Configuring and using FCKEditor in jsp environment
Fckeditor is an open source project above, which mainly realizes the function of online FCKeditor, and makes web programs have such powerful editing functions as MS Word. Official website is a server that supports languages such as ASP, ClodFusion, PHP and Java, and supports mainstream browsers such as IE 5+, Mozilla and Netscape.

First download fckeditor from official website. Note that there are two packages, one is the main file and the other is the jsp integration package.

1. Unzip FCKeditor _ 2.2.zip (FCKeditor main file) and copy the fckeditor directory to the root directory of the website.

2. Decompress FCKeditor-2.3.zip, (JSP, FCKeditor Integration Package) and its functions: This is a JSP integration package for using FCKeditor in Java server pages without the complexity of using JavaScript let or JavaScript API.

3. Copy the two servlets in fckeditor-2.3/web/web-INF/web. XML, servlets and servlet mapping definitions to the web.xml file of your own project.

modify

Servlet mapping

Servlet-name connector /servlet-name

URL-pattern/editor/file manager/browser/default/connectors/JSP/connector/URL-pattern

/servlet- mapping

Servlet mapping

servlet-name simple uploader/servlet-name

URL-pattern/ editor/file manager/upload/simple uploader /url-pattern

/servlet- mapping

for

Servlet mapping

Servlet-name connector /servlet-name

URL-pattern/FCKeditor/editor/file manager/browser/default/connectors/JSP/connector/URL-pattern

/servlet- mapping

Servlet mapping

servlet-name simple uploader/servlet-name

URL-pattern/FCKeditor/editor/file manager/upload/simple uploader/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. Add the following to the jsp interface that requires FCKeditor:

//Add at the beginning of the document

%@ taglib uri="" prefix="FCK" %

//Add to the location where you want to use it.

FCK:editor id = " content " basePath = "/FCKeditor/"

imageBrowserURL = "/FCKeditor/editor/file manager/browser/default/browser . html? type = image connector = connectors/JSP/connector

linkBrowserURL = "/FCKeditor/editor/file manager/browser/default/browser . html? Connector = connector /JSP/ connector "

flashBrowserURL = "/FCKeditor/editor/file manager/browser/default/browser . html? type = flash connector = connectors/JSP/connector "

imageUploadURL = "/FCKeditor/editor/file manager/uploader/simple uploader? Type=Image "

linkUploadURL = "/FCKeditor/editor/file manager/uploader/simple uploader? Type = File "

flashUploadURL = "/FCKeditor/editor/file manager/uploader/simple uploader? Type=Flash "

This is the default content:)

/FCK: editing

Start the server test. . . . After success, let's slim down FCKeditor.

1. Delete all folders under the FCKeditor directory and subdirectories starting with the underscore "_".

2. only fckconfig.js, 2 The FCKeditor.js, fckstyles.xml and fcktemplates.xml remain in the root directory of FCKeditor, and everything else has been deleted.

3. Empty the files and folders in the editor/file manager/upload directory.

4. You can also delete the skin files in the editor/skin directory, leaving only the default skin (if you don't need to change the skin).

5. You can also delete the files in the editor/lang directory, and only keep the files of en.js, fcklanduagemanager.js, zh-cn.js and zh.js (English, simplified Chinese and traditional Chinese should be enough:).

Yes, now let's see if it's refreshing

Other questions:

Used in struts+spring+hibernate, there may be reports in the function of uploading pictures:

The output format must have a' {}content-handler' attribute!

Case error, please try deleting xalan*. Jar in WEB-INF/lib directory.

Security issues:

If ordinary users can use FCKEditor in the foreground, they should pay attention to related security issues, and do not use the default toolbar when using it in the foreground.

To delete the Add Image, Flash and Image Field buttons.

Configuring the values in those arrays in about 78 lines in fckconfig.js is like a function on the interface, and you can forcibly try what each set of values represents. :P

This completes the installation of FCKeditor. For detailed configuration, you can check the examples in the web/_samples directory under the FCKeditor-2.3.zip (JSP, FCKeditor integration package) folder.