users@jersey.java.net

[Jersey] Re: Name Binding in jersey 2

From: Matt Hauck <matthauck_at_gmail.com>
Date: Tue, 4 Mar 2014 11:05:33 -0800

Hmm. It looks like the easiest way to accomplish what I need to accomplish is just to add two separate jersey applications to my web.xml and configure them separately. Too bad, since this does not appear to be the most efficient way to do things. But, it accomplishes the separation that I need.

Any suggestions on how to better solve this?

--
Matt Hauck


On Tuesday, March 4, 2014 at 9:53 AM, Matt Hauck wrote:

> Hello! I recently upgraded to jersey2 and would like to take advantage of the new @NameBinding meta-annotation. It appears that this only works on filters and interceptors. Is that true? I would like to use it for things like MessageBodyWriters and ExceptionMappers as well, as different segments of our app require a similar kind of formatting that needs to be consistent, whereas other legacy portions of our app need to still be generated in the older fashion and shouldn’t be affected by the new configuration.
>
> Is there a way to do this with name binding?
>
> Another problem I see with name binding is that it only appears to work when applied to a resource method, and not to a resource class? Is that true or am I mistaken? This seems like a bit of a blunder since it would be quite a pain to have to keep track of whether a particular annotation is applied to every single method in a resource class.
>
> Thanks.
>
> --
> Matt Hauck
>