users@jersey.java.net

Re: [Jersey] serving static content from a resource

From: Jan Algermissen <algermissen1971_at_mac.com>
Date: Thu, 11 Feb 2010 20:05:25 +0100

On Feb 11, 2010, at 7:54 PM, Arul Dhesiaseelan wrote:

> Hi,
>
> Is it possible to serve static content from a resource?
>
> I would like to render HTML from a resource method using explicit MVC, something like:
>
> @Path("/")
> public class RootResource {
>
> @Produces(MediaType.TEXT_HTML)
> @GET
> public Viewable getHomePage() {
> return new Viewable("/home.html", null);


Why don't you put that HTML file in a static loocation of your WAR?

Jan


> }
> }
>
> Would this work?
>
> Thank you,
> Arul
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>

-----------------------------------
 Jan Algermissen, Consultant
 NORD Software Consulting

 Mail: algermissen_at_acm.org
 Blog: http://www.nordsc.com/blog/
 Work: http://www.nordsc.com/
-----------------------------------