users@jersey.java.net

Fwd: [Jersey] Adding additional configuration to grizzly

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Fri, 04 Dec 2009 10:28:22 +0100

Hi,

Cross posting to the grizzly users list.

Paul.

Begin forwarded message:

> From: lisha jermanias <hilizbabe_at_yahoo.com>
> Date: December 3, 2009 7:35:53 PM CEST
> To: users_at_jersey.dev.java.net
> Subject: [Jersey] Adding additional configuration to grizzly
> Reply-To: users_at_jersey.dev.java.net
>
>
> Hello,
>
> My jersey with grizzly is setup using below code and it works
> great. Now I need to serve a static xml (which is not part of
> grizzly) in the root of the server.
>
> http://localhost:9988/xyz.xml
>
> How do I configure grizzly in the below code to add this xml?
>
> Map<String, String> initParams = new HashMap<String,
> String>();
> initParams.put("com.sun.jersey.config.property.packages",
> "com.xxx");
>
> ResourceConfig config = new ResourceConfig(initParams, store);
> RuntimeDelegate rd = RuntimeDelegate.getInstance();
> Adapter a = rd.createEndpoint(config, Adapter.class);
>
> logger.info("Starting grizzly...");
> try
> {
> //TODO read url from config
> URI BASE_URI =
> UriBuilder.fromUri("http://localhost/").port(9998).build();
> threadSelector = GrizzlyServerFactory.create(BASE_URI,
> a);
> logger.info("Grizzly Started. WADL: " + BASE_URI +
> "application.wadl");
> }
> catch(IOException ex)
> {
> logger.info("Error while starting grizzly...", ex);
> }
>
> Thanks
> Ben
>