开发者社区 问答 正文

weblogic war部署 路径出错? 400 报错

weblogic war部署 路径出错? 400 报错

这是我写的路径,在Tomcat中部署是没有问题的。可是公司这边一定要用war包在weblogic上部署。然后导致了路径出错,请各位老铁帮忙看一下,如何修改(百度过,上面的方案好像不太行)

展开
收起
爱吃鱼的程序员 2020-05-30 21:14:18 455 分享 版权
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    tomcat获取路径时包括一个“/”, weblogic获取路径时不包括最后的“/”

    String strVendor="weblogic";

    //得到系统路径

    if("weblogic".equals(strVendor)){

        ServletContext app=(ServletContext)pageContext.getServletContext();

        String strSysPath = app.getRealPath("/") + "/NEUUpdate/";

    }else{

        ServletContext app=(ServletContext)pageContext.getServletContext();

        String strSysPath = app.getRealPath("/") + "NEUUpdate/";

    }参考下,看看有帮助吗

    2020-05-30 21:14:20
    赞同 展开评论