The Menu JSP Page

The main menu is a JSP page, which selectively displays menu options based on the user's current state. If the user has logged in, then the option to log into the movies store is not displayed, and the option to log out of the movies store is displayed. If the user has a shopping cart, then the option to list the shopping cart is shown. If the user has logged in, then the user name is retrieved from the session attribute and displayed to the page. Alternatively, if the user has not logged in, then the option to log into the movies store is displayed and the option to log out is not displayed.

These session values are retrieved using the session object and making a call to the getAttribute method.

The index.jsp Page
 <%@ page ...

Get J2EE™ and Beyond: Design, Develop, and Deploy World-Class Java™ Software now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.