Home > Articles > Programming > Java

  • Print
  • + Share This
Like this article? We recommend 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:

  1. User requests a JSP.
  2. JSP calls a servlet (front controller in the model, view, control architecture).
  3. Servlet directs request to a JSP.
  4. JSP looks up backing bean class and creates an instance.
  5. 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.

Happy coding!

  • + Share This
  • 🔖 Save To Your Account