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

分类:Java 时间:2011-05-01 人气:146
分享到:
blog comments powered by Disqus

相关文章

  • Java version found in the editor FCKEditor file upload can not immediately remove the BUG 2010-04-02

    Previously been using FCK editor, did not find any problems, most recently editor in doing FCKEditor upload images when the thumbnails automatically generated when the function was found after uploading pictures can not be deleted, the system prompts

  • Http + Servlet file upload and download 2011-09-02

    / / Client interface package com.sky.client.face; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream;

  • Flex + Java Servlet file upload instances of 2010-01-27

    Resources are from the Internet. This example will demonstrate the use of Flex and java servlet upload files. Advance preparation is to go http://commons.apache.org download common-fileupload-1.1.1.jar and common-io-1.2.jar two packages. Front Flex C

  • Flex + Java Servlet file upload instances 2010-09-26

    Resources are from the Internet. The examples will demonstrate use of Flex and java servlet upload files. Advance preparation is to http://commons.apache.org download common-fileupload-1.1.1.jar and common-io-1.2.jar two packages. Front Flex code: Ja

  • Flex + Java Servlet File Upload Example 2010-09-26

    Resources are from the Internet. This example will demonstrate use of Flex and java servlet upload files. Advance preparation is to http://commons.apache.org download common-fileupload-1.1.1.jar and common-io-1.2.jar two packages. Front Flex code: Ja

  • Java Package Summary 2010-12-19

    Background: Recently downloaded a small open source projects, individuals made some changes and want to be labeled jar package as a custom expansion pack to use. --------- --------------- Packaged with Eclipse 1, the project does not reference an ext

  • java package design principles 2009-08-25

    A typical J2EE project, package design has matured through the routine, such as the two domain, dao, service, action, etc., functions have been decomposed and clear comparison of a single, circular to rely on such a case not much. Java in general, su

  • java jar package to find out where the java package class query 2009-05-16

    java jar package to find out where the java package class query http://jarvana.com/jarvana/ can directly view the source code, download the various versions of the jar packages and so on, strongly recommended http://www.findjar.com/index.x This did n

  • Java package for reading resources or JAR file path 2010-07-26

    Here are divided into two specific: The first: the resource file for the general suffix file The second: Resource file for picture files First] [NO1 Use this line of code can get class path of the root class String path = Thread.currentThread (). Get

  • [Java] servlet implement file upload with upload progress bar 2010-11-04

    This problem, I tried a few days, the file is uploaded, but have been unable to show progress, then I side of the access to information, while modified, was finally resolved, I hope you help me to top up, oh. Requires two JAR archive file Download: T

iOS 开发

Android 开发

Python 开发

JAVA 开发

开发语言

PHP 开发

Ruby 开发

搜索

前端开发

数据库

开发工具

开放平台

Javascript 开发

.NET 开发

云计算

服务器

Copyright (C) codeweblog.com, All Rights Reserved.

CodeWeblog.com 版权所有 黔ICP备15002463号-1

processed in 0.274 (s). 12 q(s)