-
1. Re: Can't view images with context-root set to /
jonlee Oct 20, 2003 8:45 PM (in response to just_a_w)context-root shifts around the absolute position.
web.xml url-patterns are generally relative references. So when your relative references work you can apply your context-root mapping - try not using jboss-web.xml until things are working for referencing images normally.
So if your WAR is myApp.war, try checking your application and see if things work with http://myhost/myApp. Work with your web.xml until your application operates correctly. When that is done, apply your jboss-web.xml. -
2. Re: Can't view images with context-root set to /
just_a_w Oct 20, 2003 11:48 PM (in response to just_a_w)Good call, jonlee. Taking out the context-root and setting the url-pattern to "/*" revealed that the images aren't working in that configuration either.
But why not? Why isn't the path found?
If I set the url-pattern to "/something" and navigate to http://myserver/something, I can view the images. -
3. Re: Can't view images with context-root set to /
jonlee Oct 21, 2003 2:12 AM (in response to just_a_w)Typically you only map and pattern match on specific dynamic components - servlets. So my web.xml for the WAR (in WEB-INF) is:
<servlet-name>Verify</servlet-name>
<servlet-class>com.amity.cardflex.servlet.Verify</servlet-class>
<servlet-mapping>
<servlet-name>Verify</servlet-name>
<url-pattern>/verify</url-pattern>
</servlet-mapping>
I specifically take something that matches a request for verify and call the Verify servlet.
This allows references to static content the relative path, images/myimage.jpg to be accessed. I don't have a specific map for it. In your case, I don't think you want a general "match any reference" spec in your web.xml. Taking it out will stop your request being diverted elsewhere.