Coder Social home page Coder Social logo

static resource path problem about mmt HOT 11 CLOSED

cjm0000000 avatar cjm0000000 commented on July 26, 2024
static resource path problem

from mmt.

Comments (11)

 avatar commented on July 26, 2024

like this:
http://stackoverflow.com/questions/15106978/js-css-files-not-found-due-to-path-differences-java-spring-mvc-velocity

from mmt.

 avatar commented on July 26, 2024

http://stackoverflow.com/questions/6207532/equivalent-of-curl-for-velocity

from mmt.

 avatar commented on July 26, 2024

remark:
if deploy on local tomcat with 8080 port is normal when logined on the page of
http://localhost:8080/mmt-web/webservices/message/level1/show

http://localhost:8080/mmt-web/static/assets/js/plugins/jquery-ui/jquery.ui.mouse.min.js

from mmt.

cjm0000000 avatar cjm0000000 commented on July 26, 2024

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.

from mmt.

 avatar commented on July 26, 2024

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

from mmt.

 avatar commented on July 26, 2024

http://www.***.com/webservices/message/level1/bootstrap/css/bootstrap.min.css
请教一下,这个资源路径正常吗?

from mmt.

cjm0000000 avatar cjm0000000 commented on July 26, 2024

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

from mmt.

 avatar commented on July 26, 2024

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端口的方式让其运行,是没有问题的。

from mmt.

 avatar commented on July 26, 2024

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

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

from mmt.

cjm0000000 avatar cjm0000000 commented on July 26, 2024

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

from mmt.

 avatar commented on July 26, 2024

邮件已发去你的[email protected]邮箱,请查收。谢谢了。

from mmt.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.