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

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

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