users@jersey.java.net

JerseyFilter and WebPageContentRegex

From: James Strachan <james.strachan_at_gmail.com>
Date: Thu, 11 Mar 2010 10:41:44 +0000

Specifying the regex when using the JerseyFilter is great; so you can
poke holes in your URI space and let Jersey leave it to the servlet
container to render static resources or templates or other servlets
etc.

However in the case where you define your URIs nicely so that Jersey
can know for sure whether a URI is in the JAXRS URI space or not;
should it be necessary?

The background to this is I've been hacking on a few Jersey web apps
where the JAXRS resources are quite clean - e.g. mapping just "/" and
"/foo/*" to JAXRS and the rest is all stuff like CSS, images, static
HTML, general templates etc. Now and again I find myself adding, say,
a new directory of CSS or images or whatever and finding things don't
render - then realising I've gotta mess with the Jersey regex to get
it to ignore certain URI patterns.

So I just wondered; can Jersey easily know for sure that a URI is
really outside the available JAXRS URI templates and just pass it
straight to the servlet engine? Its not a major issue, it just avoids
those head scratching moments when you forget all about having to hack
the WebPageContentRegex property in your web.xml

-- 
James
-------
http://macstrac.blogspot.com/
Open Source Integration
http://fusesource.com/