欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

FCKEditor的配置

程序员文章站 2022-03-21 18:09:37
...
一:下载最新版本的FCKeditor(FCKeditor基本文件和FCKeditot for java)
二:新建一个测试工程FCK,
三:将fckeditor目录拷贝到WebRoot目录下,
四:文件删除
1.保留_samples,editor目录和fckconfig.js,fckeditor.js,fckstyles.xml,fcktemplates.xml,
其余文件全部删除
2.进入_samples目录,保留_plugins,html目录和default.html,sample.css,sampleslist.html,其余文件全部删除
3.进入editor目录,删除_source目录
4.进入editor/lang目录,删除zh-ch.js,zh.js,en.js外的所有JS文件。。。
5.清空editor/filemanager/connectors目录
五: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>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>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>Connector</servlet-name>
		<url-pattern>/fckeditor/editor/filemanager/browser/default/connectors/jsp/connector</url-pattern>
	</servlet-mapping>

	<servlet-mapping>
		<servlet-name>SimpleUploader</servlet-name>
		<url-pattern>/fckeditor/editor/filemanager/upload/simpleuploader</url-pattern>
	</servlet-mapping>

	<welcome-file-list>
		<welcome-file>index.jsp</welcome-file>
	</welcome-file-list>
六:修改fckconfig.js
//默认语文设置
FCKConfig.DefaultLanguage		= 'zh-cn' ;
//即在编辑器域内可以使用Tab键
FCKConfig.TabSpaces		= 1 ;
//链接浏览路径
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';
//flash浏览路径
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';
//flash上传路径
FCKConfig.FlashUploadURL = FCKConfig.BasePath + 'filemanager/upload/simpleuploader?Type=Flash';
七:将commons-fileupload.jar和FCKeditor-2.3.jar拷贝到lib目录下

附件版本2.6.1
  • FCK.rar (561.9 KB)
  • 下载次数: 63