最近研究了一下Ueditor,发现图片上传功能不能直接使用,需要修改一些东西,记下来以备参考。
1. 修改com.baidu.ueditor.hunter.FileManager类下的一个方法,修改如下:
源代码:
private String getPath ( File file ) {
String path = file.getAbsolutePath();
return path.replace( this.rootPath, "/" );
}
修改为:
private String getPath ( File file ) {
String path = file.getAbsolutePath();
String str=path.replace(this.rootPath.replaceAll("\\/", "\\\\"), "\\" );
return str;
}

本文档记录了Ueditor 1.4.3 JSP版本中图片上传功能的配置步骤,包括修复‘在线管理’下图片不显示及编辑器内无法显示上传图片的问题。主要涉及FileManager类的修改和image.js文件中图片路径的调整。
最低0.47元/天 解锁文章
146





