Baidu Configurator in the default processing action can handle a variety of requests do not need to write their own, try not to break the Baidu editor's own JSP demo we can directly use the parameter configuration
The configuration of the front and back ends is written in the backend (Php version config in Php/config.json), and when the editor is instantiated, asynchronously reads the backend configuration information, overwriting it in the configuration of the front-end.
The backend Gets the configuration item > instantiates the configuration entry for the incoming configuration item > ueditor.config.js file.
The part we need to configure is
1, the location of the entrance of Ueditor.config.js
Server Unified Request interface path, if you directly use the JSP demo then here to write the access location in the demo,//We are here to do the action forwarding, through the action forwarded to Baidu provided by the demo JSP so configuration , ServerURL: RootPath + "/common/baiduuploadenter"
2, in Config.json to configure the upload image of the access prefix, that is, the URL http:127.0.0.1/projectname image save path by default relative to the Web root directory.
Baidu configuration of the JSP processor inside the code can not be moved directly to the action can only be processed in the JSP
By looking at the source code discovery because Baidu provided the demo load configuration file method is not flexible enough, if in action is not loaded in the path of the Cofig.json file.
problems with SPRINGMVC integration
Uploaded files will be Springmvc file upload interceptor interception, packaging, so Baidu Editor after receiving the file does not recognize the file format,
So the spring default Commonsmultiparresolver
Replace it with the commonsmultiparresolver we wrote ourselves.
Configuration file Modification
<!--support uploading files--><bean id= "Multipartresolver" class= "Com.fusionzoom.common.utils.CommonsMultiparResolver" ></bean>
Custom Commonsmultiparresolver release Baidu Editor's request action
public class Commonsmultiparresolver extends Org.springframework.web.multipart.commons.CommonsMultipartResolver { /** * Used to filter the Baidu editor to block commonsmultipartresolver files when uploading files * / @Override public Boolean Ismultipart (Javax.servlet.http.HttpServletRequest request) { String uri = Request.getrequesturi (); System.out.println (URI); Filter using Baidu EmEditor URI if (uri.indexof ("Common/baiduuploadenter") > 0) { System.out.println (" Commonsmultipartresolver release "); return false; } System.out.println ("commonsmultipartresolver interception"); return Super.ismultipart (Request); } }
JSP Baidu Editor Configuration Integration Springmvc attention to detail