users@jersey.java.net

Re: [Jersey] Embedded Grizzly with spring?

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Fri, 15 May 2009 13:55:45 +0200

On May 14, 2009, at 8:15 PM, tarjei wrote:

> Hi,
> More questions.
>
> This might be simple ... or not. It is also slightly OT wrt Jersey.
>
> I'm using the Freemarker provider created by Chris Winters, but I
> got two problems using it. Please note that the class is located in
> another .jar file than the resources I'm deploying.
>
> The first issue is that I need to tell the freemarker provider to
> find the templates inside another jar file.
>
> I've considered passing one of the resources in the jarfile into the
> class creating the jetty server and do
> myClass.getClass().getResource("/templates") but I'm not sure if
> this is going to work. Are there any reasons why it should work?
>

For reference here is a blog Chris wrote on his Freemarker support:

  http://www.cwinters.com/blog/2009/04/03/
jersey_freemarker_provider.html

IIUC Chris's implementation uses a web app template loader, so the
freemarker templates are expected to be in the web pages area. So i do
not think it will work as you want without modifying the initiation
code.


> The second issue is that I also want the server to be able to serve
> a couple of images and a css file also contained in the same jar. Is
> there a quick way to set up grizzly to do this as well?
>

I am not sure, best as Jean-Francois on the grizzly users list.

Paul.

> .. this is getting close to just deploying jetty, but the
> application is not mainly a web-app so I would like to not have to
> deploy a complete app-server if possible but still get the goodness
> of Spring and Jersey.
>
> Kind regards,
> Tarjei
>
> On 05/14/2009 05:03 PM, Jeanfrancois Arcand wrote:
>> Salut,
>>
>> tarjei wrote:
>>> On 05/14/2009 04:48 PM, Jeanfrancois Arcand wrote:
>>>> Salut,
>>>>
>>>> tarjei wrote:
>>>>> Hi, does anyone have a quick code example to run Jersey in an
>>>>> embedded
>>>>> Grizzly instance with resources that are populated using Spring?
>>>>
>>>> look here:
>>>>
>>>> http://is.gd/zPxW
>>>>
>>>> We just had that discussion.
>>>>
>>> Duh! Sorry for not checking the list archives.
>>
>> No sorry..the discussion happened on users_at_grizzly.dev.java.net 5
>> minutes before you asked the question :-)
>>
>> A+
>>
>> - Jeanfrancois
>>
>>>
>>> Regards,
>>> Tarjei
>>>> Thanks
>>>>
>>>> -- Jeanfrancois
>>>>
>>>>>
>>>>> kind regards,
>>>>> Tarjei
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
>>>>> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
>>>> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
>>> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
>> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>