Wildcards in <url-pattern>

From: Edward Patrick (EPatrick_at_alldata.net)
Date: 02/26/04


Date: 25 Feb 2004 15:19:07 -0800

Hello,

I would like to have one servlet serve all requests that do not
require any "processing". For example, CSS's, JPG's, etc.

I know I can accomlish this with an entry in WEB.XML:

<servlet-mapping>
        <servlet-name>ForwardServlet</servlet-name>
        <url-pattern>*.css</url-pattern>
</servlet-mapping>

However; here's my problem. Let's say a page has the following:

<LINK rel=style*** type="text/css" href="style.css">

Now, since there is no mapping then "style.css" must reside in the
root. However; I can have my servlet search for "style.css". Let's
say it finds it at "MyApp/ThisClient/style.css".

So, my servlet adds the path and then forwards it on.

However; since WEB.XML says "*.css", well, now my request with
"MyApp/ThisClient/style.css" gets caught too.

The result is an endless loop until the server dies.

Is there any way around this?

I want the css file caught by WEB.XML the first time, after I build
the full path, I just want to serve it.

Any help out there?

Thanks,
Ed


Quantcast