How to configure and use FCKeditor in JSP Environment

Source: Internet
Author: User
Tags zip folder

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, on the server side support ASP. NET, ASP, clodfusion, PHP,

Java and other languages, and supports mainstream browsers such as IE 5 +, Mozilla, and Netscape.

Download FCKeditor from the official website. Note that there are two packages: The main file and the JSP integration package.

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, FCKeditor integration package), role: 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 the servlet-mapping definition in the FCKeditor-2.3/web/WEB-INF/Web. XML to the Web. xml file of your 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>
 

Is:

<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 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/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 the server test .... After success, the FCKeditor will be reduced.

1. Delete all folders starting with "_" in the FCKeditor directory and subdirectory

2. Only fckconfig. JS, FCKeditor. JS, fckstyles. XML, and fcktemplates. XML are retained in the root directory of FCKeditor.

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

Finished. Is it refreshing now?

Other problems:

When used in STRUTS + spring + hibernate, the image upload function may report:

The output format must have a' {http://xml.apache.org/xalan=content-handler' property!

If the error occurs, try removing xalan *. Jar under the WEB-INF/lib directory.

Security Questions:

If FCKeditor can be used by common users on the foreground, pay attention to related security issues. Do not use the default toolbar when using the foreground. Remove the buttons for adding images, Flash, and image domains, in fckconfig. about 78 lines in JS configure the values in those arrays, just like a function on the interface, you can

Each group of values is represented by a row.

The fckeditorinstallation is complete. For detailed configuration, see the examples in the Web/_ samples directory in the fckeditor-2.3.zip folder (JSP, FCKeditor integration package.

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.