ckeditor4.5.11+ckfinder_java2.6.2 Configuration

Source: Internet
Author: User
Tags tomcat server

http://blog.csdn.net/skyman1942/article/details/52537100

1. Environment Description:

Date: 2016-09-14

Tool: ckeditor_4.5.11+ckfinder_java_2.6.2

Environment: i5-3210m,8g DDR3,WIN10 x64,jdk1.8 x64

Development tools: Eclipse Neon x64 (the Web plugin that may be used is not mentioned here)

2. Tool Pack:

Ckeditor_4.5.11_full.zip,ckfinder_java_2.6.2.zip,ckeditor-java-core-3.5.3.zip, three compressed packages can be downloaded to the official website.

3. Introduction of tools to Web Engineering (1) CKEditor
Ckeditor_4.5.11_full.zip Extract the CKEditor directory, which is structured as follows: Copy the CKEditor to the Web project WebContent directory
(4) Ckfinder
Ckfinder_java_2.6.2.zip Decompression, get the directory there is a Ckfinderjava-2.6.2.war, unzip the war into a directory, its structure is as follows: Copy the Ckfinder directory to the Web project WEBC ontent directory, copy CONFIG. xml under the Web-inf directory into the webcontent/web-inf/directory under the WEB project and rename it to Ckfinder.xml to differentiate between the others
(5) Jar Package Introduction
1) in step (4) in the War decompression directory, all jar packages under the Web-inf/lib directory are copied to the Webcontent/web-inf/lib directory of the WEB project; 2) Ckeditor-java-core-3.5.3.zip Unzip to get a directory that Ckeditor-java-core-3.5.3.jar copied to the WEB project's Webcontent/web-inf/lib directory. Here, Web engineering webcontent directory structure such as:
(6) Toolkit refinement (in engineering)
CKEditor:

The lang directory holds internationalized files, usually only en.js and zh-cn.js;

Samples directory is the instance, delete the directory;

3 md suffix for file deletion.

Ckfinder:

_samples directory deletion;

Help directory deletion;

Lang language files, reserved en.js and zh-cn.js;

4 txt text deleted.

(Note: Further refinement is possible, please refer to other tutorials)

4, Configuration CKEditor config.js file (in the project)
Open the Config.js in the CKEditor directory;
Here is a reference, where the configuration of the Ckfinder is required
[HTML]View Plain Copy
  1. Ckeditor.editorconfig = Function (config) {
  2. Define changes to the default configuration here. For example:
  3. config.language = ' fr ';
  4. Config.uicolor = ' #FF0000 ';
  5. /*
  6. config.toolbar_full = [
  7. [' Source ', '-', ' Save ', ' NewPage ', ' Preview ', '-', ' Templates '],
  8. [' Cut ', ' Copy ', ' Paste ', ' pastetext ', ' Pastefromword ', '-', ' Print ', ' spellchecker ', ' Scayt '],
  9. [' Undo ', ' Redo ', '-', ' Find ', ' Replace ', '-', ' selectall ', ' Removeformat '],
  10. [' Form ', ' Checkbox ', ' Radio ', ' TextField ', ' Textarea ', ' Select ', ' Button ', ' ImageButton ', ' HiddenField '],
  11. ‘/‘,
  12. [' Bold ', ' Italic ', ' underline ', ' Strike ', '-', ' subscript ', ' superscript '],
  13. [' Numberedlist ', ' BulletedList ', '-', ' outdent ', ' Indent ', ' Blockquote '],
  14. [' Justifyleft ', ' justifycenter ', ' justifyright ', ' Justifyblock '],
  15. [' Link ', ' Unlink ', ' Anchor '],
  16. [' Image ', ' Flash ', ' Table ', ' horizontalrule ', ' Smiley ', ' Specialchar ', ' pagebreak '],
  17. ‘/‘,
  18. [' Styles ', ' Format ', ' Font ', ' FontSize '],
  19. [' TextColor ', ' BGColor ']
  20. ];
  21. */
  22. Cancel edit box drag and Drop zoom
  23. config.resize_enabled=false;
  24. Filebrowserbrowseurl = '/ckfinder/ckfinder.html ';
  25. Filebrowserimagebrowseurl = '/ckfinder/ckfinder.html?type=images ';
  26. Filebrowserflashbrowseurl = '/ckfinder/ckfinder.html?type=flash ';
  27. Filebrowseruploadurl = '/ckfinder/core/connector/java/connector.java?command=quickupload&type=files '  ;
  28. Filebrowserimageuploadurl = '/ckfinder/core/connector/java/connector.java?command=quickupload&type=  Images ';
  29. Filebrowserflashuploadurl = '/ckfinder/core/connector/java/connector.java?command=quickupload&type=  Flash ';
  30. };
5, configuration Ckfinder.xml

Open the Ckfinder.xml in the Web-inf directory.

1) <enabled>true</enabled>,true means open cfinder.

2) <baseurl>http://localhost:8080/model2message/upload/</baseurl>, this tag specifies the directory where the file is uploaded,

Tomcat Server access address + project name + Receive folder + "/", I created a upload directory under the project's publishing path, so this is the access path.

3) User access rights are set under the Accesscontrols tab,

[HTML]View Plain Copy
  1. <accesscontrols>
  2. <AccessControl>
  3. <role>*</role>
  4. <resourcetype>*</resourcetype>
  5. <folder>/</folder>
  6. <folderview>true</folderview>
  7. <foldercreate>true</foldercreate>
  8. <folderrename>true</folderrename>
  9. <folderdelete>false</folderdelete>
  10. <fileview>true</fileview>
  11. <fileUpload>true</fileUpload>
  12. <filerename>true</filerename>
  13. <filedelete>false</filedelete>
  14. </AccessControl>
  15. </accesscontrols>

6. Configure Web. xml
you can refer to Web. XML under the Web-inf directory in the Extract directory of the war in Step 3-(4)
.

[HTML]View Plain Copy
  1. <servlet>
  2. <servlet-name>connectorservlet</servlet-name>
  3. <servlet-class>com.ckfinder.connector.connectorservlet</servlet-class>
  4. <init-param>
  5. <param-name>xmlconfig</param-name>
  6. <span style="color: #ff0000;" ><param-value>/web-inf/ckfinder.xml</param-value><!- -ckfinder.xml is renamed CONFIG.</span>
  7. </init-param>
  8. <init-param>
  9. <param-name>debug</param-name>
  10. <param-value>false</param-value>
  11. </init-param>
  12. <load-on-startup>1</load-on-startup>
  13. </servlet>
  14. <servlet-mapping>
  15. <servlet-name>connectorservlet</servlet-name>
  16. <url-pattern>/ckfinder/core/connector/java/connector.java</url-pattern>
  17. </servlet-mapping>
7. Use on JSP page

This is created using tags.

<%@ taglib uri= "http://ckeditor.com" prefix= "ce"%>
<%@ taglib uri= "Http://cksource.com/ckfinder" prefix= "CF"%>

Note that the Ckfinder label should be placed before the ckeditor tag.

<cf:setupckeditor editor= "ed1" basepath= "/model2message/ckfinder/"/>
<ce:editor editor= "ed1" basepath= "/model2message/ckeditor/" ></ce:editor>

Note: The above simple configuration, need to achieve more features, please refer to other tutorials, thank you message.

ckeditor4.5.11+ckfinder_java2.6.2 Configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.