1 25 26 package org.objectweb.jonas.webapp.jonasadmin.security; 27 28 import java.io.IOException ; 29 30 import javax.management.ObjectName ; 31 import javax.servlet.ServletException ; 32 import javax.servlet.http.HttpServletRequest ; 33 import javax.servlet.http.HttpServletResponse ; 34 35 import org.apache.struts.action.ActionForm; 36 import org.apache.struts.action.ActionForward; 37 import org.apache.struts.action.ActionMapping; 38 import org.objectweb.jonas.jmx.JonasManagementRepr; 39 import org.objectweb.jonas.jmx.JonasObjectName; 40 import org.objectweb.jonas.webapp.jonasadmin.JonasAdminJmx; 41 import org.objectweb.jonas.webapp.jonasadmin.JonasBaseAction; 42 43 46 47 public class SaveRealmAction extends JonasBaseAction { 48 49 51 public ActionForward executeAction(ActionMapping p_Mapping, ActionForm p_Form 52 , HttpServletRequest p_Request, HttpServletResponse p_Response) 53 throws IOException , ServletException { 54 55 try { 57 ObjectName onRealms = JonasObjectName.allSecurityFactories(); 58 ObjectName onRealm = new ObjectName (JonasAdminJmx.getFirstMBeanName(onRealms)); 59 JonasManagementRepr.invoke(onRealm, "saveConfig", null, null); 60 } 61 catch (Throwable t) { 62 addGlobalError(t); 63 saveErrors(p_Request, m_Errors); 64 return (p_Mapping.findForward("Global Error")); 65 } 66 67 String sForward = p_Request.getParameter("forward"); 69 if (sForward == null) { 70 sForward = "ActionListRealms"; 71 } 72 73 return (p_Mapping.findForward(sForward)); 75 } 76 77 79 } 80 | Popular Tags |