01: /**
02: * Copyright (c) 2006 Red Hat, Inc. All rights reserved.
03: *
04: * This library is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 2.1 of the License, or any later version.
08: *
09: * This library is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: * Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public
15: * License along with this library; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
17: * USA
18: *
19: * Component of: Red Hat Application Server
20: *
21: * Initial Developers: Greg Lapouchnian
22: * Patrick Smith
23: *
24: */package olstore.controller;
25:
26: import javax.servlet.http.HttpServletRequest;
27: import javax.servlet.http.HttpServletResponse;
28:
29: import org.springframework.web.servlet.ModelAndView;
30: import org.springframework.web.servlet.mvc.Controller;
31: import org.springframework.web.servlet.view.RedirectView;
32:
33: /**
34: * The controller used for the sign out action.
35: */
36: public class SignOutController implements Controller {
37:
38: /**
39: * When spring intercepts a request to the specified path (in olstore-servlet.xml) the
40: * request is handled here.
41: *
42: * @param request the HttpServletRequest object.
43: * @param response The HttpServletResponse object.
44: * @throws Exception
45: */
46: public ModelAndView handleRequest(HttpServletRequest request,
47: HttpServletResponse response) throws Exception {
48: request.getSession().invalidate();
49:
50: return new ModelAndView(new RedirectView("/store/index.do",
51: true));
52: }
53:
54: }
|