Using fckeditor__jsp in a JSP

Source: Internet
Author: User
Using FCKeditor in a JSP
1.1 Runtime Commons-fileupload-1.1.jar Fckeditor-2.3.jar 1.2 Editor Version FCKeditor 2.0 FCKeditor is an online editor that contains almost all of the online editors that are now online, The realization of the function is quite perfect, at the same time can customize the function button, support the configuration installment in the multiple language environment

1.3 Using the steps 1.3.1 the WEB application directory structure


1.3.2 Configuration Description <?xml version= "1.0" encoding= "UTF-8"?>
<! DOCTYPE Web-app Public "-//sun Microsystems, INC.//DTD Web Application 2.3//en" "Http://java.sun.com/dtd/web-app_2_3. DTD ">
<web-app>
<display-name>demo</display-name>
<servlet>
<servlet-name>connector</servlet-name><!-is used to list uploaded file lists-->
<servlet-class>com.fredck.FCKeditor.connector.ConnectorServlet</servlet-class>
<init-param>
<param-name>baseDir</param-name>
<param-value>/userfiles/</param-value><!-Upload file storage path-->
</init-param>
<init-param>
<param-name>debug</param-name><!-Display Debug Information-->
<param-value>true</param-value>
</init-param>
Load--> when <load-on-startup>1</load-on-startup><!-starts
</servlet>
<servlet>
<servlet-name>simpleuploader</servlet-name><!-for uploading Files-->
<servlet-class>com.fredck.FCKeditor.uploader.SimpleUploaderServlet</servlet-class>
<init-param>
<param-name>basedir</param-name><!-Upload file storage path-->
<param-value>/UserFiles/</param-value>
</init-param>
<init-param>
<param-name>debug</param-name><!-Display Debug Information-->
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>enabled</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>deniedextensionsfile</param-name><!-reject upload file type list-->
<param-value>php|php3|php5|phtml|asp|aspx|ascx|jsp|cfm|cfc|pl|bat|exe|dll|reg|cgi</param-value>
</init-param>
<init-param>
<param-name>allowedextensionsimage</param-name><!-allow upload of picture type list-->
<param-value>jpg|gif|jpeg|png|bmp</param-value>
</init-param>
<init-param>
<param-name>allowedextensionsflash</param-name><!-allow upload of flash type list-->
<param-value>swf|fla</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Connector</servlet-name>
<url-pattern>/FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector</url-pattern> <!-a servlet map for listing uploaded files-->
</servlet-mapping>
<servlet-mapping>
<servlet-name>SimpleUploader</servlet-name>
<url-pattern>/FCKeditor/editor/filemanager/upload/simpleuploader</url-pattern>
</servlet-mapping><!-a servlet map for uploading files-->
<taglib>
<taglib-uri>fck</taglib-uri><!-Tag Library Mapping-->
<taglib-location>/WEB-INF/classes/FCKeditor.tld</taglib-location>
</taglib>
</web-app>
1.3.3 JSP Reference method


1.3.4 Run demo



1.3.5 JSP original <% @page contenttype= "text/html; CHARSET=GBK "%>
<% @taglib uri= "FCK" prefix= "FCK"%>
<title>index</title>
<body bgcolor= "#ffffff" >
<form action= "postdata.jsp" Name= "Form1" method= "POST" >
Document title: <input type= "text" name= "test" value= "testing Data"/>
<fck:editor id= "Editordefault" basepath= "/fckeditor/"
Fontnames= "Song body; Arial; Courier New; Times New Roman; Verdana "
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 ">
The following content is <strong> test data </strong>. Welcome to use <a href= "http://www.fredck.com/fckeditor/" &GT;FCKEDITOR&LT;/A&GT;.
</FCK:editor>
<input type= "Submit" value= "submitted"/>
</form>
</body>

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.