users@jersey.java.net

Re: [Jersey] Initialization

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Fri, 14 Aug 2009 08:26:58 +0200

On Aug 14, 2009, at 1:45 AM, dloy wrote:

> I'm just starting to look at Jersey - can someone direct me to any
> web page describing how to set up servlet initialization
> (init(ServletConfig servletConfig)) Properties - tomcat environment
> - that are then accessible to the Jersey Root Resource.
>

The following section in the users guide describes some deployment
options for servlet:

   https://jersey.dev.java.net/documentation/1.1.1-ea/user-
guide.html#d4e115

It is possible to inject ServletContext from which init-params may be
obtained.

   https://jersey.dev.java.net/documentation/1.1.1-ea/user-
guide.html#d4e412

e.g.

   @Path("/")
   public MyRootResource {
     @Context ServletContext sc;

   }

Does that help?

Paul.