开发者

Tomcat Configure To Serve Static Files is not working

I have linux machine, on which I have deployed my project. I have some static content which I have placed at /var/grt_dynamic_images on physical harddisk on linux. I am using it as /EchlonSurvey/images/dynamic/images. It is working fine on windows but not on linux.

Here is the server.xml file snapshot, where I am doing this configuration.

<Context docBase="/var/grt_dynamic_images" path="/EchelonSurvey/images/dynamic_images" />
        <Context docBase="/var/grt_dynamic_images/category_images" path="/Ec开发者_开发知识库helonSurvey/images/dynamic_images/cat_images" />
        <Context docBase="/var/grt_dynamic_images/profile_images" path="/EchelonSurvey/images/dynamic_images/prof_images" />

In webpage, I get 404 error. The path is same but the image are not coming from docBase. I have checked, there are all image which I need.

http://.../EchelonSurvey/images/dynamic_images/cat_images/277152_9449%20sml.png image not available


one suggestion. if you have a ROOT webapp, you can create a symbolic link within it and point to the folder you want to serve. so something like

/tomcat/webapps/ROOT:  ln -s /var/grt_dynamic_images /EchelonSurvey/images/dynamic_images

when i do this, it 'works' but only if i am specifying an actual resource on the url, like a .png file. i still get 404's if i just stop the url at a folder level. i'm sure there's some Tomcat setting for displaying a folder listing but haven't looked into it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜