FCKeditor的运用

30 篇文章 0 订阅
12 篇文章 0 订阅
web.xml
<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>false</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-mapping>
  
	<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>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></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>DeniedExtensionsImage</param-name>
			<param-value></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></param-value>
		</init-param>
		<load-on-startup>1</load-on-startup>
	</servlet>
  <servlet-mapping>
    <servlet-name>SimpleUploader</servlet-name>
    <url-pattern>/fckeditor/editor/filemanager/upload/simpleuploader</url-pattern>
  </servlet-mapping>

html:

<script>
window.onload = function()
{
	 var oFCKeditor = new FCKeditor('contentText');//传入参数为表单元素(由FCKeditor生成的input或textarea)的name
      oFCKeditor.BasePath='<%= contextPath %>/fckeditor/';//指定FCKeditor根路径,也就是fckeditor.js所在的路径
      oFCKeditor.Width='800';
      oFCKeditor.Height='100%';
      oFCKeditor.SkinPath='<%= contextPath %>/fckeditor/editor/skins/silver/';
      oFCKeditor.ToolbarSet='Default';//指定工具栏
      //oFCKeditor.Value='';//默认值
      oFCKeditor.Config['ToolbarStartExpanded'] = true ;
  	oFCKeditor.ReplaceTextarea();
}
</script>

<tr height="100%">
                        <td class="td_left">新闻内容:</td>
                        <td class="td_right">
                        	<html:textarea property="contentText" cols="60" rows="50" style="width: 800px; height: 500px"></html:textarea>
                        </td>
                    </tr>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值