Create a new Web project Ckfinder, import the Lib package
Add Java package, encoding format UTF-8
Add Ckedtior and Ckfinder two folders under Webroot to copy Config. Web-inf into
To modify the config configuration file
Then modify the Config.js file, the file path points to the Ckfinder under Webroot, and you can modify the toolbar display and so on.
Configuring Servlets in Web. xml
<!--ckeditor+ckfinder text editor, being - <servlet> <Servlet-name>Connectorservlet</Servlet-name> <Servlet-class>Com.ckfinder.connector.ConnectorServlet</Servlet-class> <Init-param> <Param-name>Xmlconfig</Param-name> <Param-value>/web-inf/config.xml</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>Connectorservlet</Servlet-name> <Url-pattern>/ckfinder/core/connector/java/connector.java</Url-pattern> </servlet-mapping> <Filter> <Filter-name>Fileuploadfilter</Filter-name> <Filter-class>Com.ckfinder.connector.FileUploadFilter</Filter-class> <Init-param> <Param-name>Sessioncookiename</Param-name> <Param-value>Jsessionid</Param-value> </Init-param> <Init-param> <Param-name>Sessionparametername</Param-name> <Param-value>Jsessionid</Param-value> </Init-param> </Filter> <filter-mapping> <Filter-name>Fileuploadfilter</Filter-name> <Url-pattern>/ckfinder/core/connector/java/connector.java</Url-pattern> </filter-mapping> <Session-config> <Session-timeout>10</Session-timeout> </Session-config> <!--ckeditor+ckfinder text editor, end -
Import JS in JSP
<type= ' text/javascript ' src= ' ${pagecontext.request.contextpath} /ckeditor/ckeditor.js '></script><type = "Text/javascript" src= ' ${pagecontext.request.contextpath}/ckfinder/ Ckfinder.js '></script>
Use the following methods as follows:
:
The uploaded file is
Rich Text editor CKEditor inheritance