O'Reilly logo

J2EE™ and Beyond: Design, Develop, and Deploy World-Class Java™ Software by Art Taylor

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required