users@jersey.java.net

Re: [Jersey] Static references from JSP

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Tue, 02 Sep 2008 08:52:36 +0200

On Sep 2, 2008, at 8:46 AM, Paul Sandoz wrote:

> On Sep 2, 2008, at 8:13 AM, Craig McClanahan wrote:
>
>> Paul Sandoz wrote:
>>> Julio Faerman wrote:
>>>> I have tried to write out the resource, but this is troublesome
>>>> as the
>>>> resource is not on the classpath. I think there is a method to
>>>> get web
>>>> resources in servlet 2.5,
>>>
>>> You need to use methods on the ServletContext.
>>>
>>>
>>>> but i also think that the forward should
>>>> work.
>>>
>>> I cannot get it to :-( it works for JSPs, but not for "static"
>>> stuff like HTML and images, perhaps it is bug in the GF servlet
>>> implementation i am using?
>>>
>>>
>> What servlet mappings do you have defined?
>>
>
> "/" or "/*". I want to avoid a URL for the main application like:
>
> http://host:80/<deployment base>/<jersey base>
>
> and exposing out the other resources (static or JSP pages) explicitly.
>
> I can forward to JSPs but not to static content.
>

After more investigation

- If the URL pattern is "/" then i can forward to JSPs but not to
static content.

- If the URL pattern is "/*" then i cannot forward to JSPs nor static
content.

Paul.