Does JSF has a method similar to Servlet API (service...)
1 posts in topic
Flat View  Flat View

Posted By:   kramer_joao
Posted On:   Friday, February 27, 2009 12:33 PM

Does JSF has a method similar to Servlet API

public void service(javax.servlet.ServletRequest req, javax.servlet.ServletResponse res) throws javax.servlet.ServletException, java.io.IOException;

This method is called every time a request is submitted to the servlet. We need such a feature in JSF in order to make some stuf at each request (the managed-bean-scope must be session).

Is there such a method?



Re: Does JSF has a method similar to Servlet API (service...)

Posted By:   Anonymous  
Posted On:   Thursday, March 12, 2009 02:06 PM

Knowing exactly what you are trying to accomplish would help. There is no specific method to handle something on every request in JSF formally. You can make a Filter that filter's JSF requests, but your code would not be in the JSF context, but that would only matter depending on what you are trying to do. You can also write a PhaseListener to run code on each request.

There is an easy solution for doing this with a Gracelets, a combination of Groovy+JSF/Facelets (http://gracelets.sourceforge.net) and in particular this part (http://gracelets.sourceforge.net/manual/current_version/chapters/tutorial/writing_lib_jsf.html#phaselistener)

Hope that gives you some options.
About | Sitemap | Contact