users@jersey.java.net

Re: [Jersey] Noobie question, sorry: pre-filtering requests

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Thu, 24 Jul 2008 14:47:35 +0200

Hi Jim,

You can write a Jersey-based filter using the latest 0.9 snapshot. See
this email thread for writing Jersey filters:

http://markmail.org/search/?q=list%3Anet.java.dev.jersey.users+filter#query:list%3Anet.java.dev.jersey.users%20filter+page:1+mid:p7yxygz4wpakqno5+state:results

A similar type of filter could also be written for the client side API
(for testing and other purposes).

Would the filter you plan to write be a generic filter with no
application dependencies? if so would you be open to contributing such a
filter back to the Jersey project?

Paul.

Jim Powers wrote:
> Just getting up to speed here. I already looked in the archive, but
> perhaps I'm asking the question incorrectly.
>
> What I would like to do is to essentially write a filter that
> pre-processes all incoming requests before the designated handlers get
> invoked. The particular issue is that our restful requests are
> HMAC-ed and I don't want to put in a call in each service routine to
> call out to validate the HMAC (p.i.t.a. as well as something the can
> be overlooked). Is this something that the Jersey libs supports or do
> I just have to write a "classical" filter?
>
> In our case GET requests can have (basically) any combination of URL
> and/or request header parameters, we are planning to support both, and
> combinations of both (the header parameters are marked with a
> particular prefix). Any help would be appreciated.
>

-- 
| ? + ? = To question
----------------\
    Paul Sandoz
         x38109
+33-4-76188109