1 25 26 package org.objectweb.jonas.webapp.jonasadmin.resource; 27 28 import java.util.Properties ; 29 30 import javax.servlet.ServletException ; 31 import javax.servlet.http.HttpServletRequest ; 32 import javax.servlet.http.HttpServletResponse ; 33 34 import org.apache.struts.action.ActionForm; 35 import org.apache.struts.action.ActionForward; 36 import org.apache.struts.action.ActionMapping; 37 import org.objectweb.jonas.jmx.JonasManagementRepr; 38 import org.objectweb.jonas.jmx.JonasObjectName; 39 import org.objectweb.jonas.webapp.jonasadmin.WhereAreYou; 40 41 44 public class ApplyMimePartMailFactoryPropertiesAction extends EditMailFactoryPropertiesAction { 45 public ActionForward executeAction(ActionMapping p_Mapping, ActionForm p_Form 46 , HttpServletRequest p_Request, HttpServletResponse p_Response) 47 throws ServletException { 48 49 MailFactoryPropertiesForm oForm = (MailFactoryPropertiesForm) m_Session.getAttribute("mailFactoryPropertiesForm"); 51 String name = oForm.getMailFactoryName(); 53 try { 54 boolean mimePartFactory = true; 56 Properties props = getPropsFromForm(oForm, mimePartFactory); 57 Boolean fromFile = new Boolean (true); 58 Object [] aoParam = { name, props, fromFile }; 59 String [] asSign_3 = { "java.lang.String", "java.util.Properties", "java.lang.Boolean" }; 60 JonasManagementRepr.invoke(JonasObjectName.mailService(), "createMailFactoryMBean", aoParam, asSign_3); 61 m_WhereAreYou.setCurrentJonasDeploymentType(WhereAreYou.DEPLOYMENT_MAIL); 63 refreshTree(p_Request); 64 } catch (Throwable t) { 65 addGlobalError(t); 66 saveErrors(p_Request, m_Errors); 67 return (p_Mapping.findForward("Global Error")); 68 } 69 m_Session.removeAttribute(""); 71 return (p_Mapping.findForward("ActionListMailFactories")); 72 } 73 } 74 | Popular Tags |