In JSF, you already use the servlet, FacesServlet
, which you most likely already registered in web.xml
yourself to run JSF. This is the servlet that eliminates the need to write a bunch of servlets to perform repetitive tasks, such as collecting request parameters, converting / checking them, updating javabean properties, invoking actions, and switching to the correct view.
In JSF, you do not need to create additional servlets to perform these tasks. You simply create and declare a managed bean as a controller, which in turn contains a simple javabean class as a model that is bound to the user interface components in the view.
But sometimes the JSF is too overkill or too zealous when someone has never recognized the JSF before and just wants two, three or four web pages to have only a contact form. JSF has a relatively steep learning curve that requires a clear understanding of HTTP servlets. With "plain vanilla" servlets and JSP, it is easier to develop. But whenever a site grows out of its borders and you start copying / reorganizing common tasks, you would be happy if you chose the MVC structure in advance.
source share