/** * @param mapping * @param form * @param request * @param response * @return ActionForward * @throws Exception */ public ActionForward toggleActiveDns( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { WebForwardForm webForwardForm = (WebForwardForm) form; if (webForwardForm.isActiveDNS()) { webForwardForm.setHostHeader(""); } return mapping.findForward("display"); }
/* (non-Javadoc) * @see com.adito.policyframework.actions.AbstractResourceDispatchAction#commit(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) */ public ActionForward commit( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { WebForwardForm webForwardForm = (WebForwardForm) form; if (WebForwardForm.ATTR_NO_AUTHENTICATION.equals(webForwardForm.getAuthenticationType())) { webForwardForm.setPreferredAuthenticationScheme(HttpAuthenticatorFactory.NONE); webForwardForm.setAuthenticationUsername(""); webForwardForm.setAuthenticationPassword(""); webForwardForm.setFormType(WebForwardTypes.FORM_SUBMIT_NONE); webForwardForm.setFormParameters(""); } else if (WebForwardForm.ATTR_FORM_BASED_AUTHENTICATION.equals( webForwardForm.getAuthenticationType())) { webForwardForm.setPreferredAuthenticationScheme(HttpAuthenticatorFactory.NONE); webForwardForm.setAuthenticationUsername(""); webForwardForm.setAuthenticationPassword(""); } else if (WebForwardForm.ATTR_HTTP_BASED_AUTHENTICATION.equals( webForwardForm.getAuthenticationType())) { webForwardForm.setFormType(WebForwardTypes.FORM_SUBMIT_NONE); webForwardForm.setFormParameters(""); } ActionForward actionForward = super.commit(mapping, form, request, response); saveMessage(request, "editWebForward.message.saved"); return actionForward; }