使用ueditor,点击在线管理,服务器图片路径显示不正确,如下图所示

查看源码,如下:

发现图片src中中间多了一长串的项目跟路径,解决的办法是
把 jsp/controller.jsp 里面的代码修改一下
- <%@ 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
- "imageManagerActionName": "listimage",
- "imageManagerListPath": "/ueditor/jsp/upload/image/",
- "imageManagerListSize": 20,
- "imageManagerUrlPrefix": "/ueditor",
- "imageManagerInsertAlign": "none",
- "imageManagerAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"],
解决ueditor编辑器图片在线管理图片无法显示
原文:http://www.cnblogs.com/justuntil/p/7648854.html