开发者

JAX-RS/Jersey: How can I "inherit" @Provider fields?

In JAX-RS one can define @Provider-annotated fields or inner-classes (such as for MessageBodyReader or ExceptionMapper).

Sadly, I can't inherit this logic from a super class. (When I do, JAX-RS simply ignores them.)

I have several JAX-RS resource classes, so I don't want to copy+paste these 开发者_如何学Pythonproviders in each of them.

So, how can I define providers in a project-"global" sense?


in your WEB-INF/web.xml

<init-param>
<param-name>com.sun.jersey.config.property.packages</param-name>
<param-value>
your.package.one;your.package.two
</param-value>
</init-param>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜