users@jersey.java.net

serving static content from a resource

From: Arul Dhesiaseelan <arul_at_fluxcorp.com>
Date: Thu, 11 Feb 2010 11:54:31 -0700

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);
  }
}

Would this work?

Thank you,
Arul