3

when we develop web app using JSP and servelt here, servlet act as a CONTROLLER (from MVC perspective). then what acts as the controller when i am developing web app using JSF and Facelets...

is it something related with - JSF - request dispatcher servlets - httprequest httpresponse

or am taking it completely wrong.

exexzian
  • 7,782
  • 6
  • 41
  • 52

1 Answers1

6

Well, there is the FacesServlet (that you register in the web.xml file, first thing when setting up your JSF project), which IMO is the closest to the MVC controller.

Some people also seem to regard the Backing Beans as controllers, but I don't think they are, not really... Although the Backing Beans can affect the results of navigation, for example, or maybe writing some stuff directly to the HttpResponse and signalling the end of JSF's lifecycle, they are actually instanced and used by the Faces Servlet, which is the real resposinble for dispatching things.

See also: What is the difference between JSF, Servlet and JSP?

Community
  • 1
  • 1
Elias Dorneles
  • 22,556
  • 11
  • 85
  • 107