Baidu Ueditor integrated into the SSH2 project

Source: Internet
Author: User

1, in order to let Struts2 not intercept the editor file upload, the filter will be changed to intercept *.action

<filter> <filter-name>struts2</filter-name> <filter-class> org.apache.struts2.dispatcher.ng.filter.strutsprepareandexecutefilter</filter-class></filter>< Filter-mapping> <filter-name>struts2</filter-name> <url-pattern>*.action</url-pattern ></filter-mapping>

2, of course, to copy the ue-jsp version of a few folders and JS files into the Project Web root directory, the UE provided by the several jar package copy into the Lib directory and remove the duplicate jar package

3, modify the ueditor.config.js file, modify the corresponding configuration

Required Options

Window. Ueditor_home_url: Application Context Path

Available options:

Autofloatenabled: whether to float the top toolbar

elementpathenabled: whether to display the bottom element path

Initialframewidth: Initialize editor width

Initialframeheight: Initialize editor height

initialcontent: Initializing editor content

toolbars: top Toolbar

4, config upload file: modify jsp/config.json file, above image example other files are modified in a similar way

imageurlprefix: Apply context path

imagepathformat: picture save path format

5, solve the editor upload file online management picture Display error problem (the editor shows an absolute path)

A, delete UeditoR-1.1.1.jain the R packageCom.baidu.ueditor.hunter.FileManager.class File

B, create a new Com.baidu.ueditor.hunter.FileManager.javaunder Application classpath, copy the deleted class file back into the file, and modify the GetPath method as follows

Private String GetPath (file file) {String path = Pathformat.format (File.getabsolutepath ()); Return Path.replace (This.rootpath, "/");}

6, solve the foreground code is not highlighted

A, the introduction of CSS Files

<link rel= "stylesheet" href= "Ueditor/third-party/syntaxhighlighter/shcoredefault.css" >

B. Introduction of JS File

<script type= "Text/javascript" src= "Ueditor/third-party/syntaxhighlighter/shcore.js" ></script>

C, call JS highlighting

Syntaxhighlighter.all ();

7. Resolve highlighting Burst page, modify ueditor/third-party/syntaxhighlighter/shcoredefault.css file

Will

. syntaxhighlighter{width:100%!important;margin:.3em 0.3em 0!important;position:relative!important;overflow:auto! Important;background-color: #f5f5f5!important;border:1px solid #ccc!important;

Replaced by

. syntaxhighlighter{width:100%!important;margin:.3em 0.3em 0!important;position:relative!important;overflow:auto! Important;background-color: #f5f5f5!important;border:1px solid #ccc!important;word-break:break-all;

That is, adding in . Syntaxhighlighter

Word-break:break-all;

Baidu Ueditor integrated into the SSH2 project

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.