tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Funk <>
Subject Re: Static resource mapping in web.xml
Date Wed, 08 Jun 2011 14:47:00 GMT
 Your "easiest" workaround is to use a filter.

1) have the default servlet map to /* (which is the default)
2) keep the invoker declared
3) And make your filter do this ...

doFilter(..) {
  if (request.getServletPath().matches(regex-here)) {

Where regex-here is something which limits the mayhem you are imposing on
yourself ..
like this: "/servlet/com\.yourcompany\..+"


On 6/8/2011 10:17 AM, wrote:

Dear all,

                I'm faceing the following problem in tomcat (probably just

                I have a WEBAPP which uses the "invoker" servlet (i know how
bad it is, but for now it gets the job done).

                The static content is under "/images/" path.

                So a tipical URL was

                To avoid the "servlet" part of the URL I layed hands in

                This is the result:











                The problem is that static content is not shown under
"images", it is shown under "images/images".

                For example:


 http://host:8080/webapp/images/images/help.png                    OK

                In order to keep things as tidy as possible I would like
static content to be served under "images".

                Using ROOT is not an option because this tomcat is shared
among several WEBAPPS.

                Is there anything wrong with my configuration or am I
missing something?

                This post addresses the same issue:

                Thanks in advance and please excuse my bad English.

                Best regards,


                OS                          CentOS 5

                Tomcat                6.0.29

                JVM                      1.6.0_20-b02

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message