jsr339-experts@jax-rs-spec.java.net

[jsr339-experts] PreMatchRequestFilter ambiguities and issues

From: Bill Burke <bburke_at_redhat.com>
Date: Wed, 22 Feb 2012 12:11:16 -0500

I assume that PreMatchRequestFilter exist to allow you do do things like
extract Accept information from a URI like:

http://.../foo/bar.txt

And change its matching path to;

http://.../foo/bar

correct? How would you do something like this? There's a big
difference between a path you're gonna match against and the absolute
URI and the base URI. RequestBuilder has redirect methods, but the
problem is that the filter has no way of getting at UriInfo information.
Plus another side effect is that a call to the redirect() method on the
server side really messes up the information in UriInfo. Like how can
you recalculate the BaseURI, etc. consistently?

Am I making any sense?

Maybe there should be a redirectPath() method on RequestBuilder? On the
client side, this would just change the URI path. On the server side,
this would only change the path the value of UriInfo.getPath() i.e. the
path relative to the baseURI.

Also maybe we should think about not allowing a change to the URI, but
instead just a change in the path? So remove redirect() methods from
RequestBuilder and change them to just one:

path(String path);


Client side, this method would change the URI path. Server side, just
the relative path to BaseURI.


-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com