一、上传配置
1、要实现上传图片,首先要配置 ueditor.cong.js
其中 POI 为项目名称,ueditor 为插件所在文件夹
2、ueditor 成功上传图片后却回显不出来,这是因为路径问题,可以在 jsp/cong.json 这个
文件去改路径.
上传时是通过“imageUrlPrex”与“imagePathFormat”这两个属性去拼凑路径
“imageUrlPrex”是前缀的意思,将 imageUrlPrex 设置为项目名称
二、在线图片管理配置
ueditor 图片在线管理不能显示的问题原因是:
它使用的是 tomcat 项目中的绝对路径
后来在 ueditor 的 github 论坛上找到了解决方法,是 ueditor jar 包本身的 bug
1、解决方法一:
在 ueditor.jar 的源码中修改修改 FileManager.java 文件中的 getPath 方法,然后
达成 jar 包,再重新引用。
FileManager.java 文件中的 getPath 方法修改为
private String getPath ( File le ) {
//String path = le.getAbsolutePath();
String path = PathFormat.format(le.getAbsolutePath());
return path.replace(this.rootPath, "" );
}
评论7
最新资源