The Entertain(r) application we've been developing (see Part II) has a new set of requirements - apart from managing movies only:
(1) It needs to become user-based. This includes the ability to add, edit, delete, and find users.
(2) Users must be logged in to view pages or do anything else on the system.
(3) All pages should have a standard menu that includes links to lists of users, movies, and the home page.
(4) Have a generic error page for the application.
(5) Handle database cell overflow problems.
Fullfilling these requirements will demonstrate how to use servlet filters, call JavaBeans from JSP pages, use EJB 3.0 stateless beans, and configure a generic error page for the application using NetBeans 5.5. At the end of the exercise, a basic infrastructure will exist that we can use to further explore EJB 3.0 features.
#1: a user entity must be created, with an accompanying session bean. It'll use the persistence unit we already have. Also, a servlet that does user-oriented business logic needs to be created (adding, editing, deleting, finding).
#2: Create a servlet filter that checks all requests for authentication and redirects to the login page if not logged in.
#3: Create a servlet filter that uses a response wrapper to add the menu to the response.
#4: Configure a JSP page as the error page and update the web descriptor for the web module.
#5: Check for content length and truncate, or redirect to the error page.
An auterior goal is also to find out how long it takes to add such support to an application