The use of FCKeditor in jsp


Because the use FCKeditor to do press releases, so start a large area to find information, may have sent two friends will wonder why FCKeditor in the same article describes the use of JSP, because I found a long article by one may not be able to comprehensive learning configure FCKeditor, so I think that a more complete turn to two articles to reference. Most of the content of two articles basically the same, but there are different places. I think these two articles by at least grasp the basic use FCKeditor. Of course the focus is on its upload functionality. Be fully mastered today FCKeditor in a JSP application. I will write an estimate that only I can see to understand the article to record the details of use. Oh want to help my friends later!

In http://www.fckeditor.net/ download FCKeditor 2.3 and FCKeditor.Java package FCKeditor-2.3.jar
Configuring web.xml support FCKEditor file upload and browse pictures

<Servlet>
<Servlet-name> Connector </ servlet-name>
<Servlet-class> com.fredck.FCKeditor.connector.ConnectorServlet </ servlet-class>
<Init-param>
<Param-name> baseDir </ param-name>
<Param-value> / uploadfiles / </ param-value>
</ Init-param>
<Init-param>
<Param-name> debug </ param-name>
<Param-value> false </ param-value>
</ Init-param>
<Load-on-startup> 2 </ load-on-startup>
</ Servlet>
<Servlet>
<Servlet-name> SimpleUploader </ servlet-name>

<Servlet-class> com.fredck.FCKeditor.uploader.SimpleUploaderServlet </ servlet-class>
<Init-param>
<Param-name> baseDir </ param-name>
<Param-value> / uploadfiles / </ param-value>
</ Init-param>
<Init-param>
<Param-name> debug </ param-name>

<Param-value> false </ param-value>
</ Init-param>
<Init-param>
<Param-name> enabled </ param-name>
<Param-value> true </ param-value>
</ Init-param>
<Init-param>
<Param-name> AllowedExtensionsFile </ param-name>
<Param-value />
</ Init-param>
<Init-param>
<Param-name> DeniedExtensionsFile </ param-name>
<Param-value> php | php3 | php5 | phtml | asp | aspx | ascx | jsp | cfm | cfc | pl | bat | exe | dll | reg | cgi | htm | html </ param-value>
</ Init-param>
<Init-param>
<Param-name> AllowedExtensionsImage </ param-name>
<Param-value> jpg | gif | jpeg | png | bmp </ param-value>
</ Init-param>
<Init-param>
<Param-name> DeniedExtensionsImage </ param-name>

<Param-value />
</ Init-param>
<Init-param>
<Param-name> AllowedExtensionsFlash </ param-name>
<Param-value> swf | fla </ param-value>

</ Init-param>
<Init-param>
<Param-name> DeniedExtensionsFlash </ param-name>
<Param-value />
</ Init-param>
<Load-on-startup> 1 </ load-on-startup>
</ Servlet>
<! - Depending on the application to modify their own url-pattern ->
<Servlet-mapping>
<Servlet-name> Connector </ servlet-name>
<Url-pattern> / components / fck / editor / filemanager / browser / default / connectors / jsp / connector </ url-pattern>
</ Servlet-mapping>

<Servlet-mapping>
<Servlet-name> SimpleUploader </ servlet-name>
<Url-pattern> / components / fck / editor / filemanager / upload / simpleuploader </ url-pattern>
</ Servlet-mapping>

1.3 by adding FCKeditor-2.3.jar and commons-fileupload.jar
1.4 However, the file fckeditor too much, people gratuitous spasm, delete the following directories and files:
1./_testcases, / _samples,
2./editor/_source, / editor/skins/office2003, / editor / skins / silver,
/ Editor / filemanager / upload, / editor / filemanager / browser / default / connector
3./editor/lang retain only en.js, zh_cn.js
4. In / the php, py file extension, etc.
5. Delete plugin directory and the directory spellcheck dialog
1.5 to a clean directory to the project fck
Edit Profile fckconfig.js 1.6
FCKConfig.DefaultLanguage = 'zh-cn';
Remove the spell check changes related to the following two places url, use fckeditor servelt to do file upload and directory browsing:

FCKConfig.LinkBrowserURL = FCKConfig.BasePath
"Filemanager / browser / default / browser.html? Connector = connectors / jsp / connector"
;
FCKConfig.ImageBrowserURL =
FCKConfig.BasePath "filemanager / browser / default / browser.html? Type = Image & Connector = connectors / jsp / connector"
;
FCKConfig.FlashBrowserURL = FCKConfig.BasePath "filemanager / browser / default / browser.html? Type = Flash & Connector = connectors / jsp / connector";
FCKConfig.LinkUploadURL = FCKConfig.BasePath
'Filemanager / upload / simpleuploader? Type = File';
FCKConfig.FlashUploadURL =
FCKConfig.BasePath 'filemanager / upload / simpleuploader? Type = Flash'
;
FCKConfig.ImageUploadURL = FCKConfig.BasePath 'filemanager / upload / simpleuploader? Type = Image';

If you still have time to fix it FCKConfig.ToolbarSets ["Default"], leaving only the functionality required.
The use in JSP

<% @ Page language = "java" import = "com.fredck.FCKeditor .*"%>
<%
FCKeditor oFCKeditor;

oFCKeditor = new FCKeditor (request, "content");
oFCKeditor.setBasePath ("/ cms / admin / components / fck /"); ---- FCK the path
oFCKeditor.setValue ("value"); ---- the value of text box
out.println (oFCKeditor.create ());
%>

Upload encountered an error: internal server error 500,
Direct reference to the servlet (com.fredck.FCKeditor.connector.ConnectorServlet) has encountered an error: "Provider org.apache.xalan.processor.TransformerFactoryImpl not found",
Copy xalan.jar to lib directory to be the


<! - EndFragment ->
  • del.icio.us
  • StumbleUpon
  • Digg
  • TwitThis
  • Mixx
  • Technorati
  • Facebook
  • NewsVine
  • Reddit
  • Google
  • LinkedIn
  • YahooMyWeb

Related Posts of The use of FCKeditor in jsp

  • Hibernate configuration parameters hibernate.hbm2ddl.auto

    Hibernate in the configuration file: <properties> <property name="hibernate.hbm2ddl.auto" value="create" /> </ properties> Parameter Description: validate load hibernate, the authentication to create a database t ...

  • spring + hibernate + oracle9i to read and write CLOB

    Database-driven update classes12-9i.jar Hibernate modify the configuration of the following code <bean/> <bean Lazy-init="true"> <property name="nativeJdbcExtractor"> <ref local="nativejdbcExtractor"/>

  • Build flex + spring + blazeds + hibernate application

    Build flex + spring + blazeds + hibernate application First, set up the project blazeds 1, will blazeds.war extract to a directory, such as: myflex /; 2, set up java works were such as: MyFlex, in the orientation of selection create project from exis ...

  • Hibernate connection pool configuration

    Hibernate connection pool configuration <! - Jdbc -> <property name="connection.driver_class"> oracle.jdbc.driver.OracleDriver </ property> <property name="connection.url"> jdbc: oracle: thin: @ 10.203.14.132:15

  • hibernate generic generic DAO

    package org.lzpeng.dao; import java.io.Serializable; import java.util.List; import org.hibernate.Criteria; import org.hibernate.Query; import org.hibernate.criterion.Criterion; import org.springside.modules.orm.hibernate.Page; /** * * @version 2009-1-10 *

  • Servlet brief introduction

    Servlet brief introduction: Servlet is a small application server Are used to complete the B / S architecture, the client requests the response to treatment Platform independence, performance, able to run thread Servlet API for Servlet provides the s ...

  • Struts2 + hibernate + spring problem user log in

    dao layer services layer action jsp <tr> <td align="center"> <b> user name: </ b> </ td> <td> <s: textfield name = "czyNumber" cssClass = "textstyle" theme = "simple" size = &q

  • Hibernate secondary cache

    Hibernate cache: 2-bit cache, also known as process-level cache or SessionFactory level cache, secondary cache can be shared by all of the session Cache configuration and the use of: Will echcache.xml (the document code in hibernate package directory ...

  • Hibernate's lazy strategy

    hibernate Lazy strategy can be used in: <class> tag, it can be true / false Tags can <PROPERTY> values true / false type of necessary tools to enhance <set> <list> can tag values true / false / extra <many-to-one> <on ...

blog comments powered by Disqus
Recent
Recent Entries
Tag Cloud
Random Entries