# spring-ueditor **Repository Path**: zhanghw/spring-ueditor ## Basic Information - **Project Name**: spring-ueditor - **Description**: spring-boot ueditor - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2017-12-07 - **Last Updated**: 2021-06-21 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## spring-ueditor 本项目根据百度ueditor源码修改: [百度Ueditor官网](http://ueditor.baidu.com/website/index.html)。 ## 集成spring-boot 1. 下载jsp版本,复制到 /resources/static/ 下 修改 ueditor.config.js: ``` // 服务器统一请求接口路径 , serverUrl: URL + "config" ``` 2. 复制 config.json 到 application.properties 同级目录 3. 编译本项目或[下载jar](https://gitee.com/zhanghw/spring-ueditor/attach_files) 4. 在application.properties 中配置上传绝对路径 ``` #上传绝对路径 web.upload-path=D:/ueditor/upload-dir/ spring.mvc.static-path-pattern=/** spring.resources.static-locations=classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/,file:${web.upload-path} ``` 5. 新建UEditorController.java ``` @Controller @RequestMapping("ueditor") public class UEditorController { @Value("${web.upload-path}") private String rootPath; @RequestMapping("config") public void config(HttpServletRequest request, HttpServletResponse response){ response.setContentType("application/json"); try { String exec = new ActionEnter(request, rootPath).exec(); PrintWriter writer = response.getWriter(); writer.write(exec); writer.flush(); writer.close(); } catch (IOException e) { e.printStackTrace(); } } } ``` 6. 运行项目,测试上传,web.upload-path目录将生成 upload-dir 文件夹