cjm0000000 / mmt

微信、易信接入

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

static resource path problem

opened this issue · comments

when i deploy in tomcat on my aliyun server ,
the index path request is normal,
http://www.***.com/static/assets/js/plugins/jquery-ui/jquery.ui.core.min.js

but static resource path problem occured once i logined
http://www.***.com/webservices/message/level1/static/assets/js/plugins/jquery-ui/jquery.ui.core.min.js

Please double check your configure. It's no problem with version 1.0 in my server with port 80.

My Tomcat version is 7. May be you should use Nginx server to process static resources.

mmt-web打包为war后,部署在tomcat下,未登录之前静态资源访问正常,登录后,静态资源路径不正确。
你打包后有没有尝试一下直接放在tomcat下试试呢?

1.0 的部署在tomcat 7 下面(直接把war包扔在webapps目录)没有你说的资源文件错误的问题,上面的资源文件路径肯定是不正确的。
这可能和你deploy的方式有关。

http://www.***.com/index;jsessionid=87F35605398756F0B9962CE532FD12A2.tomcat1

到这里还是可以加载静态资源的,现在转到
http://www.***.com/webservices/message/level1/show

资源加载路径就变成了这样的:
http://www.***.com/webservices/message/level1/bootstrap/css/bootstrap.min.css
第一次遇到这种情况,我是httpd+tomcat,httpd负责处理静态资源。

此时点击页面导航,跳转BUG:
http://www.***.com/webservices/message/level1/webservices/system

的确,直接把war放在单独一个tomcat下面(没有和Apache结合的tomcat),通过8080端口的方式让其运行,是没有问题的。

#set($root = $context.webApplicationContext.servletContext.contextPath)

我想会不会和velocity的获取contextPath的问题导致的?因为部署在Apache+tomcat下root的值是空/空字符的。

能提供一份Apache的转发规则吗?(如果可以请直接发送到我邮箱,我明天做下测试)我这边Tengine + Tomcat 没有你说的问题。

邮件已发去你的green120@126.com邮箱,请查收。谢谢了。