Hello Jersey users,
I'm trying to hack upon the jersey-ext-mvc-jsp module in the Jersey
2.1.4 branch and produce a jersey-ext-mvc-facelets. The goal is to
make
it so facelets can be used just as well as JSP, Freemarker, or Mustache
with Jersey.
I want to make it so some stuff happens eagerly, at deployment time, in
my jersey extension. I'm struggling with how to make this happen since
everything in Jersey seems to be optimized to be as lazy as possible.
Basically, I want something like what I get with the init() method on a
Servlet. I tried making my FaceletsMvcFeature implement
ApplicationEventListener, but it seems the onEvent() is never called.
Can you please give me some pointers? Here is my oh-so-simple app.
8<------------
@javax.ws.rs.ApplicationPath("webresources")
public class ApplicationConfig extends ResourceConfig {
public ApplicationConfig() {
packages(HelloWorld.class.getPackage().getName());
register(FaceletsMvcFeature.class);
}
}
8<------------
@Path("helloworld")
public class HelloWorld {
/**
* Retrieves representation of an instance of helloWorld.HelloWorld
* @return an instance of java.lang.String
*/
@GET
@Produces("text/html")
public Viewable getHtml() {
return new Viewable("index.jsp", "INDEX");
}
8<------------
The FaceletsMvcFeature is simply a renamed clone of the JspMvcFeature.
I need to initialize some JSF nonsense before any requests are
processed.
Thanks,
Ed