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