users@jersey.java.net

Re: [Jersey] Setting properties for ResourceConfig

From: Harald Kirsch <pifpafpuf_at_gmx.de>
Date: Mon, 28 Jul 2008 08:43:57 +0200

Paul,

in such cases, I wouldn't mind to extend the Javadocs myself. But I am
not sure I want write access to the subversion repository. Would you
accept patches? That way, you could look over it, *before* it goes into
subversion.

Whereto should I send them? Or should I create issues in the bug
tracking system with a patch then?

Harald.

Am 27.07.2008 17:39 schrieb Paul Sandoz:
> 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.
>>
>

-- 
--------------+---------------------------------------------
Harald Kirsch | pifpafpuf bei gmx punkt de