FCKeditor For Java/Jsp

[ 2006-05-17 18:20:35 | Author: zhenhua ]
Font Size: Large | Medium | Small
1.下载
FCKeditor.java 2.3/FCKeditor-2.3.zip (FCKeditor for java)
FCKeditor_2.3b.zip (FCKeditor基本文件)

2.建立项目:Project/FCKeditor

3.FCKeditor.java FCKeditor-2.3.zip解压后,把其中的web目录下的WEB-INF目录copy到FCKeditor下(里面有commons-fileupload.jar, FCKeditor-2.3.jar,web.xml等几个文件), 把其中的src目录下的FCKeditor.tld文件copy到FCKeitor/WEB-INF/下


4.修改web.xml:
把SimpleUploader中的配置属性enabled定义为true(开启文件上传功能),加上editor所在目录, 下面红色是增加的部分
 <servlet-mapping>
 <servlet-name>Connector</servlet-name>
 <url-
pattern>/[color=Red]FCKeditor[/color]/editor/filemanager/browser/default/connectors/jsp/connector</url-
pattern>
 </servlet-mapping>
 
 <servlet-mapping>
 <servlet-name>SimpleUploader</servlet-name>
 <url-pattern>/[color=Red]FCKeditor[/color]/editor/filemanager/upload/simpleuploader</url-pattern>
 </servlet-mapping>
添加标签定义:
<taglib>
<taglib-uri>/FCKeditor</taglib-uri>
<taglib-location>/WEB-INF/FCKeditor.tld</taglib-location>
</taglib>

5.解压FCKeditor_2.3b.zip后,把目录/editor和fckconfig.js, fckeditor.js, fckstyles.xml, fcktemplates.xml四个文件copy到/FCKeditor下
删除目录/editor/_source,
删除/editor/filemanager/browser/default/connectors/下的除了test.html外的所有文件夹
删除/editor/filemanager/upload/下除了test.html外的所有文件夹
删除/editor/lang/下的除了en.js, zh.js, zh-cn.js三个文件外的所有文件

6.打开/FCKeditor/fckconfig.js
修改 FCKConfig.DefaultLanguage = 'zh-cn' ;
把FCKConfig.LinkBrowserURL等的值替换成以下内容:
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.ImageUploadURL = FCKConfig.BasePath + 'filemanager/upload/simpleuploader?Type=Image' ;
FCKConfig.FlashUploadURL = FCKConfig.BasePath + 'filemanager/upload/simpleuploader?Type=Flash' ;

7.三种方法调用FCKeditor
(1).FCKeditor自定义标签 (必须加头文件 <%@ taglib uri="/FCKeditor" prefix="FCK" %> )
显示
<form action="show.jsp" method="post" target="_blank">
<FCK:editor id="content" basePath="/FCKeditor/" width="700" height="500" skinPath="/FCKeditor/editor/skins/silver/"
 toolbarSet = "Default" >
input
</FCK:editor>
<input type="submit" value="Submit">
</form>
(2).script脚本语言调用 (必须引用 脚本文件 <script type="text/javascript" src="/FCKeditor/fckeditor.js"></script> )
显示
<form action="show.jsp" method="post" target="_blank">
<table border="0" width="700"><tr><td>
<textarea id="content" name="content" style="WIDTH: 100%; HEIGHT: 400px">input</textarea>
<script type="text/javascript">
var oFCKeditor = new FCKeditor('content') ;
oFCKeditor.BasePath = "/FCKeditor/" ;
oFCKeditor.Height = 400;
oFCKeditor.ToolbarSet = "Default" ;
oFCKeditor.ReplaceTextarea();
</script>
<input type="submit" value="Submit">
</td></tr></table>
</form>
(3).FCKeditor API 调用 (必须加头文件 <%@ page language="java" import="com.fredck.FCKeditor.*" %> )
<form action="show.jsp" method="post" target="_blank">
<%
FCKeditor oFCKeditor ;
oFCKeditor = new FCKeditor( request, "content" ) ;
oFCKeditor.setBasePath( "/FCKeditor/" ) ;
oFCKeditor.setValue( "input" );
out.println( oFCKeditor.create() ) ;
%>
<br>
<input type="submit" value="Submit">
</form>

8.输出:
<%
String content = request.getParameter("content");
out.print(content);
%>

ok!

另:FCKeditor for Java的上传是通过servlet进行的,不是Jsp,所以配置文件web.xml中的"editor/filemanager/browser/default/connectors/jsp/connector" jsp/connector 目录并不存在,只要配置好FCKeditor.java就行了,最后上传非常快
Comments Feed Comments Feed: http://www.zhenhua.org/feed.asp?q=comment&id=321
UTF-8 Encoding Trackback URL: http://www.zhenhua.org/trackback.asp?id=321

View Mode: Show All | Comments: 0 | Trackbacks: 345 | Toggle Order | Views: 35546
Trackback where can i get cheap tenuate
[ where can i get cheap tenuate | 2012-11-19 03:16:16 ]
Brand and Generic Drugs, Discount Pharmacy. All information about where can i get cheap tenuate in one place: http://barlet.mywebcommunity.org/tenuate/where-can-i-get-cheap-tenuate.html
Trackback buy ephedrine canada
[ buy ephedrine canada | 2012-12-01 01:24:48 ]
Brand and Generic Drugs, Discount Pharmacy. All information about buy ephedrine canada in one place: http://beuzin.snn.gr/ephedrine/buy-ephedrine-canada.html
Trackback menstrual disorders
[ menstrual disorders | 2012-12-15 10:24:30 ]
Brand and Generic Drugs, Discount Pharmacy. All information about menstrual disorders in one place: http://schmid.snn.gr/provera/menstrual-disorders.html
Trackback clarithromycin sun
[ clarithromycin sun | 2012-12-20 21:12:15 ]
Brand and Generic Drugs, Discount Pharmacy. All information about clarithromycin sun in one place: http://maires.xhost.ro/clarithromycin/clarithromycin-sun.html
Trackback clifton arimidex
[ clifton arimidex | 2012-12-30 19:58:34 ]
Brand and Generic Drugs, Discount Pharmacy. All information about clifton arimidex in one place: http://feria.snn.gr/arimidex/clifton-arimidex.html
Trackback buy atorvastatin canada
[ buy atorvastatin canada | 2013-01-16 02:43:34 ]
Brand and Generic Drugs, Discount Pharmacy. All information about buy atorvastatin canada in one place: http://perso.wanadoo.es/fdezrico/atorvastatin/buy-atorvastatin-canada.html
Trackback waukegan vicodin
[ waukegan vicodin | 2013-01-20 22:51:04 ]
Brand and Generic Drugs, Discount Pharmacy. All information about waukegan vicodin in one place: http://perso.wanadoo.es/kukaina444/vicodin/waukegan-vicodin.html
Trackback tadalafil bargain
[ tadalafil bargain | 2013-02-08 10:04:22 ]
Brand and Generic Drugs, Discount Pharmacy. All information about tadalafil bargain in one place: http://nada.snn.gr/tadalafil/tadalafil-bargain.html
Trackback saginaw augmentin
[ saginaw augmentin | 2013-02-12 21:49:22 ]
Brand and Generic Drugs, Discount Pharmacy. All information about saginaw augmentin in one place: http://hem.passagen.se/fundamentalist/augmentin/saginaw-augmentin.html
Trackback lasix water pill
[ lasix water pill | 2013-03-20 09:05:25 ]
Brand and Generic Drugs, Discount Pharmacy. All information about lasix water pill in one place: http://haren.altervista.org/lasix/lasix-water-pill.html
Trackback shreveport zerit
[ shreveport zerit | 2013-06-04 09:12:09 ]
Brand and Generic Drugs, Discount Pharmacy. All information about shreveport zerit in one place: http://rotte.altervista.org/zerit/shreveport-zerit.html
Trackback order canada
[ order canada | 2013-06-19 03:00:23 ]
Brand and Generic Drugs, Discount Pharmacy. All information about order canada in one place: http://perso.wanadoo.es/ma099/flexeril/order-canada.html
Trackback percodan
[ percodan | 2013-07-04 01:59:46 ]
Brand and Generic Drugs, Discount Pharmacy. All information about percodan in one place: http://smile.world.mu/percodan/
Trackback minocycline hci
[ minocycline hci | 2013-07-08 08:34:49 ]
Brand and Generic Drugs, Discount Pharmacy. All information about minocycline hci in one place: http://digilander.libero.it/Molinense/accutane/minocycline-hci.html
Trackback drugs india
[ drugs india | 2013-07-22 22:24:55 ]
Brand and Generic Drugs, Discount Pharmacy. All information about drugs india in one place: http://orosco.snn.gr/restoril/drugs-india.html
Trackback guaynabo lortab
[ guaynabo lortab | 2013-07-30 07:00:28 ]
Brand and Generic Drugs, Discount Pharmacy. All information about guaynabo lortab in one place: http://digilander.libero.it/rupar/lortab/guaynabo-lortab.html
Trackback rocklin amaryl
[ rocklin amaryl | 2013-08-08 07:22:14 ]
Brand and Generic Drugs, Discount Pharmacy. All information about rocklin amaryl in one place: http://bridel.altervista.org/amaryl/rocklin-amaryl.html
Trackback can imovane get you high
[ can imovane get you high | 2013-08-23 04:37:20 ]
Brand and Generic Drugs, Discount Pharmacy. All information about can imovane get you high in one place: http://borj.altervista.org/imovane/can-imovane-get-you-high.html
Trackback diazepam on line
[ diazepam on line | 2013-09-07 00:28:02 ]
Brand and Generic Drugs, Discount Pharmacy. All information about diazepam on line in one place: http://digilander.libero.it/ricky.menphis/diazepam/diazepam-on-line.html
Trackback flagyl in pregnancy
[ flagyl in pregnancy | 2013-09-11 02:05:59 ]
Brand and Generic Drugs, Discount Pharmacy. All information about flagyl in pregnancy in one place: http://burky.eu.pn/flagyl/flagyl-in-pregnancy.html

If you feel this site you find this information helpful, please click on the donation, which is voluntary,Thank you.
Post Comment
Smilies
[arrow] [biggrin] [confused] [cool]
[cry] [eek] [evil] [exclaim]
[frown] [idea] [lol] [mad]
[mrgreen] [neutral] [question] [razz]
[redface] [rolleyes] [sad] [smile]
[surprised] [twisted] [wink]
Enable UBB Codes
Auto Convert URL
Show Smilies
Hidden Comment
Username:   Password:   Register Now?
Security Code * Please Enter the Security Code