users@jersey.java.net

Re: [Jersey] Static references from JSP

From: sarat.pediredla <sarat.pediredla_at_gmail.com>
Date: Wed, 11 Feb 2009 08:08:59 -0800 (PST)

I would love to try this out but I believe this is not in 1.0.2. Is this in
1.0.3-SNAPSHOT for me to try out, so I don't have to build a local version
of jersey?


jstrachan wrote:
>
> 2009/1/31 sarat.pediredla <sarat.pediredla_at_gmail.com>:
>>
>> Hi all,
>>
>> Just to add to this thread and get some clarification.
>>
>> Is the bottom line now that I cannot use Jersey with static resources? I
>> was
>> hoping to replace Struts 2 (which I mainly use for MVC rather than the
>> extraneous stuff) with Jersey in a new project and consider my dismay
>> when I
>> realised that if I set Jersey to map to /* then I could not serve ANY
>> static
>> resources.
>>
>> In Struts 2, all I had to do was add a filter before the Struts 2 filter
>> to
>> just forward to the static resource (JS, CSS, Image) etc.
>
> Yeah that approach should work with Jersey too
>
>
>> With Jersey using a servet in web.xml I figured this is not possible at
>> all.
>>
>> In summary, is there an easy way to have Jersey as my "main" web
>> framework
>> and have it handle (or not handle and just pass through to Tomcat),
>> requests
>> for *.js , *.css etc?
>
> There's a patch here
> https://jersey.dev.java.net/issues/show_bug.cgi?id=208
>
> which builds on Paul's servlet filter work to add a regex property to
> the servlet filter so you can configure what servlet paths are static
> content and let your web container serve those up. I wonder if you
> could try that patch out on your web application and see if it does
> the trick?
>
> If you apply the patch you'll see the bookstore example serves up some
> static content (/css/style.css) and see the use of the regex in the
> web.xml
>
> --
> James
> -------
> http://macstrac.blogspot.com/
>
> Open Source Integration
> http://fusesource.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>
>
-- 
View this message in context: http://n2.nabble.com/Static-references-from-JSP-tp794843p2309566.html
Sent from the Jersey mailing list archive at Nabble.com.