users@jersey.java.net

Re: MessageBodyWriter woes

From: ljnelson <ljnelson_at_gmail.com>
Date: Thu, 22 Apr 2010 04:27:32 -0800 (PST)

On Thu, Apr 22, 2010 at 8:06 AM, Paul Sandoz [via Jersey]
<ml-node+4942354-1385555507-210534_at_n2.nabble.com> wrote:
> Not quite, because those resource classes require a base path (can be
> defined as a URL pattern in the servlet). We wanted to avoid defining a
> default base path.
> The simplest way to do that without messing around with a web.xml is to do
> the following:
>   @ApplicationPath("/mybasepath")
>   public class MyApp extends Application {}
> and that will result in Jersey picking up all root resource and provider
> classes that were scanned by the Web container (note that i do not know if
> that will work for an ear deployed in a war, it should, if not then it is a
> bug in the Web container). It should be possible to refer to MyApp as the
> servlet name if you also want to provide init params to the servlet and to
> Jersey.

Paul, that is wonderful. I'll adopt that particular strategy immediately.

Best,
Laird

-- 
View this message in context: http://jersey.576304.n2.nabble.com/MessageBodyWriter-woes-tp4939544p4942415.html
Sent from the Jersey mailing list archive at Nabble.com.