KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sslexplorer > policyframework > actions > ConfigurePoliciesDispatchAction


1 /*
2  * SSL-Explorer
3  *
4  * Copyright (C) 2003-2006 3SP LTD. All Rights Reserved
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2 of
9  * the License, or (at your option) any later version.
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public
16  * License along with this program; if not, write to the Free Software
17  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  */

19             
20 package com.sslexplorer.policyframework.actions;
21
22 import javax.servlet.http.HttpServletRequest JavaDoc;
23 import javax.servlet.http.HttpServletResponse JavaDoc;
24
25 import org.apache.struts.action.ActionForm;
26 import org.apache.struts.action.ActionForward;
27 import org.apache.struts.action.ActionMapping;
28
29 import com.sslexplorer.boot.Util;
30 import com.sslexplorer.core.CoreUtil;
31 import com.sslexplorer.core.forms.CoreForm;
32 import com.sslexplorer.security.Constants;
33 import com.sslexplorer.wizard.AbstractWizardSequence;
34
35 public class ConfigurePoliciesDispatchAction extends PoliciesDispatchAction {
36
37     public ActionForward cancel(ActionMapping mapping, ActionForm form, HttpServletRequest JavaDoc request,
38                     HttpServletResponse JavaDoc response) throws Exception JavaDoc {
39         request.getSession().setAttribute(Constants.WIZARD_SEQUENCE,
40                         request.getSession().getAttribute(Constants.SUSPENDED_WIZARD_SEQUENCE));
41         request.getSession().removeAttribute(Constants.SUSPENDED_WIZARD_SEQUENCE);
42         return new ActionForward(((CoreForm)form).getReferer(), true);
43     }
44     
45     public ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest JavaDoc request,
46                     HttpServletResponse JavaDoc response) throws Exception JavaDoc {
47         // Store the current wizard flow so we can return to it when complete
48
AbstractWizardSequence seq = (AbstractWizardSequence)request.getSession().getAttribute(Constants.WIZARD_SEQUENCE);
49         if(seq != null) {
50             // get referer from parameter
51
((CoreForm)form).setReferer(CoreUtil.getRequestReferer(request));
52             request.getSession().removeAttribute(Constants.WIZARD_SEQUENCE);
53             request.getSession().setAttribute(Constants.SUSPENDED_WIZARD_SEQUENCE, seq);
54         }
55         return super.unspecified(mapping, form, request, response);
56     }
57 }
Popular Tags