Logging Out of the Movie Store

The LogOffAction class shown next is used to log users out of the shopping cart site. When executed, this class removes the user ID, user name, and other user information from the session. It also sets the LOGGED_IN and the HAS_CART session attributes set to false. Once this action is completed, the flow of control is directed back to the main menu.

The LogoffAction Class
 package examples.struts; import java.io.IOException; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException;n import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.Action; import org.apache.struts.action.ActionError; ...

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.