解决ueditor编辑器图片在线管理图片无法显示
2018-01-24 13:40
381 查看
使用ueditor,点击在线管理,服务器图片路径显示不正确,如下图所示
查看源码,如下:
发现图片src中中间多了一长串的项目跟路径,解决的办法是
把 jsp/controller.jsp 里面的代码修改一下
[java] view
plain copy
<%@ page language="java" contentType="text/html; charset=UTF-8"
import="com.baidu.ueditor.ActionEnter"
pageEncoding="UTF-8"%>
<%@ page trimDirectiveWhitespaces="true" %>
<%
request.setCharacterEncoding( "utf-8" );
response.setHeader("Content-Type" , "text/html");
String rootPath = application.getRealPath( "/" );
String action = request.getParameter("action");
String result = new ActionEnter( request, rootPath ).exec();
if( action!=null &&
(action.equals("listfile") || action.equals("listimage") ) ){
rootPath = rootPath.replace("\\", "/");
result = result.replaceAll(rootPath, "/");
}
out.write( result );
%>
然后改config.json
[java] view
plain copy
/* 列出指定目录下的图片 */
"imageManagerActionName": "listimage", /* 执行图片管理的action名称 */
"imageManagerListPath": "/ueditor/jsp/upload/image/", /* 指定要列出图片的目录 */
"imageManagerListSize": 20, /* 每次列出文件数量 */
"imageManagerUrlPrefix": "/ueditor", /* 图片访问路径前缀 */
"imageManagerInsertAlign": "none", /* 插入的图片浮动方式 */
"imageManagerAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"], /* 列出的文件类型 */
在线管理图片马上就显示出来了,如下图
查看源码,如下:
发现图片src中中间多了一长串的项目跟路径,解决的办法是
把 jsp/controller.jsp 里面的代码修改一下
[java] view
plain copy
<%@ page language="java" contentType="text/html; charset=UTF-8"
import="com.baidu.ueditor.ActionEnter"
pageEncoding="UTF-8"%>
<%@ page trimDirectiveWhitespaces="true" %>
<%
request.setCharacterEncoding( "utf-8" );
response.setHeader("Content-Type" , "text/html");
String rootPath = application.getRealPath( "/" );
String action = request.getParameter("action");
String result = new ActionEnter( request, rootPath ).exec();
if( action!=null &&
(action.equals("listfile") || action.equals("listimage") ) ){
rootPath = rootPath.replace("\\", "/");
result = result.replaceAll(rootPath, "/");
}
out.write( result );
%>
然后改config.json
[java] view
plain copy
/* 列出指定目录下的图片 */
"imageManagerActionName": "listimage", /* 执行图片管理的action名称 */
"imageManagerListPath": "/ueditor/jsp/upload/image/", /* 指定要列出图片的目录 */
"imageManagerListSize": 20, /* 每次列出文件数量 */
"imageManagerUrlPrefix": "/ueditor", /* 图片访问路径前缀 */
"imageManagerInsertAlign": "none", /* 插入的图片浮动方式 */
"imageManagerAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"], /* 列出的文件类型 */
在线管理图片马上就显示出来了,如下图
相关文章推荐
- 解决ueditor编辑器图片在线管理图片无法显示
- 解决ueditor编辑器图片在线管理图片无法显示
- 解决ueditor编辑器图片在线管理图片无法显示
- 解决ueditor百度富文本编辑器图片可以上传但是在线管理图片无法显示
- windows下ueditor1.4.3.3 jsp 版本在线管理图片显示问题。 3ff8
- JSP UEditor图片在线管理及预览时图片路径问题解决
- 删除百度Ueditor编辑器 在线管理 图片搜索 功能
- ueditor 图片在线管理显示不了发现是返回的物理路径“/”问题,在controller.jsp里做如下修改
- ueditor 图片在线管理显示不了
- ueditor1.4.3jsp版成功上传图片后却回显不出来与在线管理显示不出图片的解决方案
- ueditor编辑器asp版不能上传图片的解决方法(800a0046)
- 【搜集】卸载adobe cs4后PNG图片无法显示问题的解决办法
- 解决 python opencv无法显示图片
- 解决dede文章编辑器附件上传图标无法显示
- IE下background背景图片无法显示问题解决方法
- 解决Word 2007无法显示图片的问题
- ImageView中无法加载显示本地SDCard图片问题的解决方法
- ueditor编辑器asp版不能上传图片的解决方法 500错误
- 蚂蚁分类信息系统5.8 解决后台管理员编辑信息时相关图片无法显示的问题
- 关于使用ueditor编辑器--ueditor文件夹与编辑器初始化页面不在同一目录下,上传图片显示问题