users@jersey.java.net

Re: [Jersey] http and xml on the same path

From: Jo Størset <jo.storset_at_usit.uio.no>
Date: Thu, 15 May 2008 16:32:01 +0200

Den 15. mai. 2008 kl. 15.23 skrev Paul Sandoz:

> Another solution is to check the User-Agent header.
>
> I am reluctant to put logic directly in Jersey that does not obey
> the Accept processing rules.
>
> Perhaps the cleanest solution is to write a filter that checks the
> User-Agent header and modifies the Accept header accordingly (by
> simply prefixing "text/html," to the Accept header).
>
> Can this easily be done using a servlet filter?

Probably, I think I'll try that for now, even if I'm I bit reluctant
to base to much on the User-Agent header.

> But... we should probably add a filter concept to Jersey...to make
> it really easy to modify the request or response.

It does seem quite similar to the url postfix mapping, maybe you could
generalize that a bit?

Jo