users@jersey.java.net

Re: [Jersey] Setting properties for ResourceConfig

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Sun, 27 Jul 2008 17:39:06 +0200

Hi Harald,

Glad you worked it out. I can definitely improve the JavaDoc here. Plus
i think we should investigate how we can publish the latest JavaDoc to
the project page.

Paul.


Harald Kirsch wrote:
> Hi,
>
> some source code inspection helped to find this:-)
>
> Am 27.07.2008 11:19 schrieb Harald Kirsch:
>> Hi,
>>
>> my application is started with
>>
>> HttpServer server =
>> HttpServerFactory.create("http://localhost:"+port+'/');
>> server.start();
>>
>> and works just fine. But it scans each and every entry of the classpath
>> for resources. It does not really hurt, but it also is not nice, in
>> particular since there are configuration options to tell explicitly
>> where to search.
>
> Now I use this:
>
> Map<String, Object> props = new HashMap<String, Object>();
> props.put(ClasspathResourceConfig.PROPERTY_CLASSPATH,
> getFirst(cmdArgs, "resources", "lib/cycleroute.jar"));
> ResourceConfig rcf = new ClasspathResourceConfig(props);
>
> HttpHandler handler =
> ContainerFactory.createContainer(HttpHandler.class,
> rcf);
> HttpServer server =
> HttpServerFactory.create("http://localhost:"+port+'/', handler);
>
> And startup is muuuuuuch faster now:-)
>
> Thanks anyway,
> Harald.
>

-- 
| ? + ? = To question
----------------\
    Paul Sandoz
         x38109
+33-4-76188109