FCKeditor for Java 2.4 JSP Configuration

Source: Internet
Author: User

Original post address:

Http://hi.baidu.com/huqiwen/blog/item/7d36b15113fddd1e377abe7d.html

 

Because FCKeditor for Java 2.4 has made many changes compared with 2.3, these changes make it easier to configure FCKeditor. For example:

Changed the base package name from Com. fredck. FCKeditorNet. FCKeditor.

File Upload simpleuploaderservle is integrated into ororservlet. The web and xml configuration is much simpler. The following describes the configuration steps through an instance.

 

1. log on to www.fckeditor.net/downloadto download the latest fckeditorfile. Download two compressed packages, one of which is the basic application. The other is the configuration prepared for JSP.

The latest versions are fckeditor2.6.3 and FCKeditor for Java 2.4.

FCKeditor 2.6.3: sourceforge.net/project/downloading.php
Specific: http://easynews.dl.sourceforge.net/sourceforge/fckeditor/FCKeditor_2.6.3.zip
FCKeditor for Java: sourceforge.net/project/downloading.php
Specific: http://switch.dl.sourceforge.net/sourceforge/fckeditor/fckeditor-java-2.4-bin.zip (release version, if you need source code or demo Package please download)

After the download is: fckeditor_2.6.3.zip and fckeditor-java-2.4-bin.zip (fckeditor-java-demo-2.4.war) decompress them separately.

 

2. Create a new project under myeclipse (or other ide), for example, fckedtiortest, http: // localhost: 8080/fckeditortest.

Copy the FCKeditor folder in the decompressed fckeditor_2.6.3.zip file to the current project folder. The directory structure of my demo project is as follows:

 

3. Configure web. xml. The configuration file is as follows, which is all. Other configuration is not required. Because simpleuploaderservle is integrated into ororservlet, you do not need to configure file uploads and so on.

<Servlet>
<Servlet-Name> connector </servlet-Name>
<Servlet-class>
Net. FCKeditor. connector. connectorservlet
</Servlet-class>
<Load-on-startup> 1 </load-on-startup>
</Servlet>

<Servlet-mapping>
<Servlet-Name> connector </servlet-Name>
<URL-pattern>
/FCKeditor/Editor/filemanager/connectors /*
</Url-pattern>
</Servlet-mapping>

 

4. Create the FCKeditor. properties resource file under the src directory and write the line "connector. useractionimpl = net. FCKeditor. requestcycle. impl. useractionimpl"

 

5. Enter the test page below:

Index. jsp

<% @ Page Language = "Java" Import = "Java. util. *" pageencoding = "UTF-8" %>
<% @ Taglib uri = "http://java.fckeditor.net" prefix = "fck" %>
<HTML>
<Head>
<Title> FCKeditor test </title>
</Head>
<Body style = "text-align: center;">
<Div style = "text-align: center; width: 600pt">
<H2> FCKeditor test </H2>
<HR>
<Form action = "showdata. jsp" method = "Post">
<Fck: Editor InstanceName = "test" Height = "400pt">
<JSP: attribute name = "value"> here is the <a href = "http://hi.baidu.com/huqiwen"> data test </a>
</Jsp: attribute>
</Fck: Editor>
<Input type = "Submit" value = "Submit"/>
<Input type = "reset" value = "reset"/>
</Form>
</Div>
</Body>
</Html>

 

Data Display page: showdata. jsp

<% @ Page Language = "Java" contenttype = "text/html; charset = UTF-8"
Pageencoding = "UTF-8" %>
<Head>
<Title> FCKeditor-display data </title>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>
</Head>
<%
Request. setcharacterencoding ("UTF-8 ");
String data = request. getparameter ("test ");
%>
<Body>
<H1> FCKeditor-display data <HR/> <br/>
<% = Data %>
</Body>
</Html>

 

6. Results

Index. jsp

Showdata. jsp

 

 

7. slimming FCKeditor

Delete all files or folders starting with "_" in the FCKeditor directory, such as "_ samples" and "_documentation.html ".

Delete all files except fckconfig. js fckpackage. xml fckstyles. xml fcktemplates. xml under the FCKeditor directory, and retain the Editor folder.

Delete all files except en. js and zh-cn.js under the FCKeditor/Editor/lang directory

Delete the ORs ors folder under the FCKeditor/Editor/filemanager directory

Delete the folders under the editor/skins directory except the default folder. There are three types of folders, which can be set in fckconfig. js.

 

PS: Demo download: http://www.namipan.com/d/7218d2c0bf3e33e8aedf972b41d5d09f3efab0d8f53b0900

Again PS: for Chinese garbled problem please refer to: http://hi.baidu.com/huqiwen/blog/item/c709aa18fa187a0135fa4103.html

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.