JavaServer Faces
When working with JSP, we saw that it is not a good idea to mix scriptlets with the HTML markup. We solved this problem by using JavaBean. JavaServer Faces takes this design further. In addition to supporting JavaBeans, JSF provides built-in tags for HTML user controls, which are context aware, can perform validation, and can preserve the state between requests. We will now create the login application using JSF:
- Create a dynamic web application in Eclipse; let's name it
LoginJSFApp
. In the last page of the wizard, make sure that you check theGenerate web.xml deployment descriptor
box. - Download JSF libraries from https://maven.java.net/content/repositories/releases/org/glassfish/javax.faces/2.2.9/javax.faces-2.2.9.jar and copy them to the
WEB-INF/lib
folder in your project. - JSF follows the MVC pattern. In the MVC pattern, the code to generate user interface (view) is separate from the container of the data (model). The controller acts as the interface between the view and...