[原创]在Java中配置FCKEditor for java
2010-02-04 18:14
387 查看
上篇文章仅仅能够用它来编辑文章,但是还不能实现文件上传。要实现文件上传也很简单,官方的文档上只说了两步:配置web.xml文件和修改一个FCKEditor的配置选项。
其实如果不需要能够上传文件,也不必把所有的JAR包引入,比较重要的JAR包就这三个:
现在接着上篇文章的做。
在WEB-INF/web.xml文件里加入:
注意,其中的下的的值要根据你的FCKEditor文件夹在站点根目录下存放的位置来定,如果是在站点根目录下的话,就按上面写的就OK.
官方文档中说,为了安全,默认是不开启上传文件功能的。不信现在你测试下看看,会出现下面的提示:
默认的
在src目录下(如果你用的是MyEclipse或者Eclipse的话,否则就在WEB-INF/class/下)建立一个文件,名字为:fckeditor.properties,在里面加入如下内容:
connector.userActionImpl=net.fckeditor.requestcycle.impl.EnabledUserAction
这样之后再访问,就可以正常上传文件了。。
另外,官方的文档中提供了一些设定的值,是针对Connector的,可以设定允许上传文件的扩展名等等。
其实如果不需要能够上传文件,也不必把所有的JAR包引入,比较重要的JAR包就这三个:
现在接着上篇文章的做。
在WEB-INF/web.xml文件里加入:
1:
2:ConnectorServlet
3:
4: net.fckeditor.connector.ConnectorServlet
5:
6:1
7:
8:
9:
10:ConnectorServlet
11:
12: /fckeditor/editor/filemanager/connectors/*
13:
14:
注意,其中的下的的值要根据你的FCKEditor文件夹在站点根目录下存放的位置来定,如果是在站点根目录下的话,就按上面写的就OK.
官方文档中说,为了安全,默认是不开启上传文件功能的。不信现在你测试下看看,会出现下面的提示:
默认的
connector.userActionImpl=net.fckeditor.requestcycle.impl.DisabledUserAction
在src目录下(如果你用的是MyEclipse或者Eclipse的话,否则就在WEB-INF/class/下)建立一个文件,名字为:fckeditor.properties,在里面加入如下内容:
connector.userActionImpl=net.fckeditor.requestcycle.impl.EnabledUserAction
这样之后再访问,就可以正常上传文件了。。
另外,官方的文档中提供了一些设定的值,是针对Connector的,可以设定允许上传文件的扩展名等等。
Property | Default | Valid Values | Description |
---|---|---|---|
connector.resourceType.type name.path | /type name | any path | Indicates the resource type path to retrieve and store files. |
connector.resourceType.type name.extensions.denied | any extension | List with extensions which should be denied. Separate extensions with a | (pipe symbol). | |
connector.resourceType.file. extensions.allowed | 7z|aiff|asf|avi|bmp|csv|doc|fla| flv|gif|gz|gzip|jpeg|jpg|mid|mov| mp3|mp4|mpc|mpeg| mpg|ods| odt|pdf|png|ppt|pxd|qt|ram|rar| rm|rmi|rmvb|rtf|sdc|sitd|swf| sxc|sxw|tar|tgz|tif|tiff|txt|vsd| wav|wma|wmv|xls|xml|zip | any extension | List with extensions which should be allowed. Separate extensions with a | (pipe symbol). |
connector.resourceType.flash. extensions.allowed | swf|fla | any extension | See above. |
connector.resourceType.image. extensions.allowed | bmp|gif|jpeg|jpg|png | any extension | See above. |
connector.resourceType.media. extensions.allowed | aiff|asf|avi|bmp|fla|flv|gif|jpeg| jpg|mid|mov|mp3|mp4|mpc|mpg| mpeg|png|qt|ram|rm|rmi|rmvb| swf|tif|tiff|wav|wma|wmv | any extension | See above. |
connector.userFilesPath | /userfiles | any path | Indicates the URL path under which files can be retrieved from the server. Prepend the domain name if you want to have the full URL. For more details see here. |
connector.userFilesAbsolutePath | /userfiles | any path | Indicates the system path under which files can be stored on the backend. For more details see here. |
connector.forceSingleExtension | true | true, false (boolean) | Indicates whether filenames with multiple extensions are sanitized. |
connector.secureImageUploads | true | true, false (boolean) | Checks uploaded images for validity. I.e. the uploaded file is a real image and not any other renamed file type. (magic bytes check) |
connector.impl | net.fckeditor.connector. impl.ContextConnector | any fully-qualified class name of a valid Connector implementation | Provides a custom server-side connector for the File Browser. For more details see here. |
connector.userActionImpl | net.fckeditor.requestcycle. impl.DisabledUserAction | any fully-qualified class name of a valid UserAction implementation | Provides custom security functions for the File Browser Connector. For more details see here. |
connector.userPathBuilderImpl | net.fckeditor.requestcycle. impl.ContextPathBuilder | any fully-qualified class name of a valid UserPathBuilder implementation | Provides a custom function for constructing a user-dependent UserFilesPath for the File Browser Connector. For more details see here. |
相关文章推荐
- FckEditor for java 2.4的JSP 配置方法详解
- FCKeditor 2.6 for java配置方法
- 配置FCKeditor(FCKeditor for java)
- 【原创随笔】Eclipse Java EE IDE for Web Developers.配置Tomcat全攻略
- 【转载】FckEditor 2.6.3 for Java 2.4 配置
- FCKeditor2.4(FCKeditot for java2.3)的用法及配置参数说明(已解决中文乱码)
- jsp中怎么配置FckEditor for java 2.6
- 【转载】FckEditor 2.6.3 for Java 2.4 配置
- win7x64下配置eclipse for JAVA及C/C++ developers + MinGW + Opengl的备忘录
- FCKeditor 的配置和使用方法(for PHP)
- [原创]java web三层架构配置入门
- matlab for java 的实例配置
- source配置文件不生效 原创 2016年03月14日 18:43:55 3558 问题背景: 升级jdk 1.8之后,启动时报版本编译问题,查看$JAVA_HOME,$JRE_HOME
- FCKeditor编辑器在JAVA中的使用与配置
- 【转载】FCKeditor 2.6.3 与FCKeditor.java 2.4在JSP中配置
- HttpMessageConverter配置javaconfig(未配置异常:No converter found for return value of type)
- android开发 android studio配置opencv for android sdk,使用opencv的java函数
- rcGIS Server for java在eclipse中的配置
- FCKeditor 的配置和使用方法(for PHP)
- FckEditor java 2.6.6的JSP 配置方法详解