> We want to use a servlet filter to intercept *all* requests that come into
> the web server.  Is this possible?  It seems to work for all files when I
> put the URL filter as "/" or "/*".  But we're also looking to be notified
> when a directory resource is requested.  An example of this might be a url
> that looks like so:  "http://www.somecompany.com/test".  Test is not a
> virtual directory nor is it a directory under our site root.  We forward
> these directory requests to a JSP that then produces the appropriate output
> for this directory on the fly.
>
> Has anyone tried this?  Or is there another way to filter HTTP requests in
> the Orion web server?

Given that you seem to have worked out how to intercept /*, intercepting
/test/* is a simple extension of that.
Presumably you have something like this in your web.xml

<servlet-mapping>
        <servlet-name>WhereStuffGoesByDefault</servlet-name>
        <url-pattern>/*</url-pattern>
</servlet-mapping>

So for /test/* you'd have

<servlet-mapping>
        <servlet-name>TestServlet</servlet-name>
        <url-pattern>/test/*</url-pattern>
</servlet-mapping>

The problem is working out which order they're considered. I imagine it's
probably the order they're specified, so you'd want the test one listed first
in your web.xml. I'm assuming that by intercepting all requests you want
everything (except test/*) to go to a particular servlet. If you just mean
intercept and feed back whatever resource they asked for, then all you need is
the second code snippet in your web.xml

Trond.


Reply via email to