ueditor+SSH+weblogic+war使用总结

做这个项目时主要发现的问题是图片的上传路径的事

1.在ueditor完整配置项(editor_config.js)中添加window.UEDITOR_HOME_URL = "/项目名/ueditor/";
2.在web.xml中struts2的过滤器中配置加入红字部分,不然传入后台的request请求将改变,使上传图片失败
<!-- 通过filter配置struts2 -->
  <filter>
   <filter-name>struts2</filter-name>
   <filter-class>
   org.apache.struts2.dispatcher.FilterDispatcher
   </filter-class>
</filter>
<filter-mapping>
   <filter-name>struts2</filter-name>
   <url-pattern>/page/*</url-pattern>
</filter-mapping>
<filter-mapping>
   <filter-name>struts2</filter-name>
   <url-pattern>*.action</url-pattern>
</filter-mapping>

3.建立weblogic虚拟目录,目录名可以修改weblogic.xml中path

<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app">
 <session-descriptor> 
         <cookie-name>JSESSIONID1</cookie-name>    
 </session-descriptor> 
 <virtual-directory-mapping>
        <local-path> picUpload</local-path>
        <url-pattern>/*</url-pattern>
 </virtual-directory-mapping>    
</weblogic-web-app>
 
4.在editor_config.js中添加war虚拟目录路径
    //获取当前网址,如: http://localhost:8083/uimcardprj/share/meun.jsp  
    var curWwwPath=window.document.location.href;  
    //获取主机地址之后的目录,如: uimcardprj/share/meun.jsp  
    var pathName=window.document.location.pathname;  
    var pos=curWwwPath.indexOf(pathName);  
    //获取主机地址,如: http://localhost:8083  
    var localhostPaht=curWwwPath.substring(0,pos);  
    var rootPath =  localhostPaht + "/ueditor/";
//修改URL为roolPath
imagePath :  rootPath + "jsp/"
5.修改Upload.java中的 getPhysicalPath方法
private String getPhysicalPath(String path) {
//String servletPath = this.request.getServletPath();
//String realPath = this.request.getSession().getServletContext().getRealPath(servletPath);
//return new File(realPath).getParent() +"/" +path;
                return new File(" ueditor/jsp") +"/" +path;
}

 

6.修改getRemoteImage.jsp中
//String str = application.getRealPath(request.getServletPath());
String str =  "ueditor/jsp";
到此本地上传图片可以正常使用,但是在线管理还不能使用。
7.修改imageManager.jsp中
public String getRealPath(HttpServletRequest request,String path){
//ServletContext application = request.getSession().getServletContext();
//String str = application.getRealPath(request.getServletPath());
Stringstr = "ueditor/jsp/upload";
return new File(str).getParent();
}
8.在editor_config.js中添加war虚拟目录路径,并修改
catcherPath : rootPath + "jsp/" // 图片修正地址,同imagePath;远程图片抓取参数
imageManagerPath : rootPath + "jsp/" // 图片修正地址,同imagePath
至此百度富文本编辑器总算是能用了!附贴图
.1上传成功

 
.2插入文本框样式

 
到此在线管理还未成功,哪位大侠知道请补充一下!

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值