1 19 20 package com.sslexplorer.policyframework.actions; 21 22 import javax.servlet.http.HttpServletRequest ; 23 import javax.servlet.http.HttpServletResponse ; 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 request, 38 HttpServletResponse response) throws Exception { 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 request, 46 HttpServletResponse response) throws Exception { 47 AbstractWizardSequence seq = (AbstractWizardSequence)request.getSession().getAttribute(Constants.WIZARD_SEQUENCE); 49 if(seq != null) { 50 ((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 |