Displaying the Main Menu

The MenuAction class, as shown below, is used to prepare the main menu for the user. This involves checking to determine whether or not the user has logged into the movie store and has a cart. Two flags are set to indicate whether or not these conditions are true. These flags are placed in the session object where they are retrieved by the menu page to determine how to display the menu.

The MenuAction Class
 package examples.struts; import java.io.IOException; import java.util.Hashtable; import java.util.Locale; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import javax.servlet.http.HttpServletResponse; ...

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.