- Java Application Layers
- A New Perspective on Application Layer Integration
- A Simple JSF Example
- Running the JSF Application
Running the JSF Application
If you compile the project and create a .war file (or deploy the project directory directly to Tomcat's webapps directory), you should see the login screen shown in Figure 1 (login.jsp):
If you type "admin" as the User Name and "password" as the Password, you should see the screen shown in Figure 2 (welcome.jsp):
And that's it! Of course, you can expand on this example, but it demonstrates the basic concepts for streamlining your application.
To follow up, let's look at how a typical request in a JSF application using managed beans is handled:
- User requests a JSP.
- JSP calls a servlet (front controller in the model, view, control architecture).
- Servlet directs request to a JSP.
- JSP looks up backing bean class and creates an instance.
- Managed bean does Create Read Update Delete methods (CRUD) to database and populates JSP with any results
Much shorter and more efficient.
In a later article, I'll expand on this example using JPA to automate repetitive database operations. Also, I'll introduce you to JQL, the Java Query Language.