users@jersey.java.net

[Jersey] Re: How to do Guice-based Grizzly-in-process-based deployment?

From: Paul Sandoz <Paul.Sandoz_at_oracle.com>
Date: Thu, 16 Dec 2010 15:27:30 +0100

Hi,

You need to set your initialization parameters in the Guice module
that extends from ServletModule or JerseyServletModule and registered
in your "MyGuiceListener".

See:

http://jersey.java.net/nonav/apidocs/latest/contribs/jersey-guice/com/sun/jersey/guice/spi/container/servlet/package-summary.html

Paul.

On Dec 16, 2010, at 3:13 PM, wierob wrote:

>
> Hi,
>
> I'm trying to host my Jersey service using an embedded Grizzly
> server. The
> service is configured via a GuiceFilter.
>
> After reading the source code of the GrizzlyWebTestContainerFactory
> class I
> found the following solution:
>
> GrizzlyWebServer webServer = new GrizzlyWebServer(9999);
> ServletAdapter adapter = new ServletAdapter();
>
> adapter.addServletListener("my.package.MyGuiceListener");
> adapter.addFilter(new GuiceFilter(), "jerseyfilter", null);
> adapter.setServletPath("/");
>
> webServer.addGrizzlyAdapter(adapter, null);
> webServer.start();
> System.in.read();
> webServer.stop();
>
> However, with this setup the the
> "com.sun.jersey.config.property.WebPageContentRegex"-Feature does
> not work.
>
> Since Jersey allows:
>
> SelectorThread st = RuntimeDelegate.createEndpoint(new
> MyApplication(), SelectorThread.class);
>
> Is there something like a GuiceFilter-enabled version of
> javax.?ws.?rs.?core.Application?
>
> thanks in advance
> --
> View this message in context: http://jersey.576304.n2.nabble.com/How-to-do-Guice-based-Grizzly-in-process-based-deployment-tp5841767p5841767.html
> Sent from the Jersey mailing list archive at Nabble.com.