1 25 26 package org.objectweb.jonas.webapp.jonasadmin.resource; 27 28 import java.io.IOException ; 29 import java.util.Properties ; 30 31 import javax.management.ObjectName ; 32 import javax.servlet.ServletException ; 33 import javax.servlet.http.HttpServletRequest ; 34 import javax.servlet.http.HttpServletResponse ; 35 36 import org.apache.struts.action.ActionForm; 37 import org.apache.struts.action.ActionForward; 38 import org.apache.struts.action.ActionMapping; 39 import org.objectweb.jonas.jmx.JonasManagementRepr; 40 import org.objectweb.jonas.jmx.JonasObjectName; 41 42 43 46 public class EditMimePartMailFactoryPropertiesAction extends EditMailFactoryPropertiesAction { 47 48 50 52 public ActionForward executeAction(ActionMapping p_Mapping, ActionForm p_Form 53 , HttpServletRequest p_Request, HttpServletResponse p_Response) 54 throws IOException , ServletException { 55 56 String sName = p_Request.getParameter("name"); 58 59 MailFactoryPropertiesForm oForm = (MailFactoryPropertiesForm) m_Session.getAttribute("mailFactoryPropertiesForm"); 61 if (oForm == null) { 62 oForm = new MailFactoryPropertiesForm(); 64 m_Session.setAttribute("mailFactoryPropertiesForm", oForm); 65 } 66 67 try { 68 ObjectName mailServMBean = JonasObjectName.mailService(); 69 String [] asParam = new String [1]; 70 String [] asSignature = new String [1]; 71 asParam[0] = sName; 72 asSignature[0] = "java.lang.String"; 73 Properties oProps = (Properties ) JonasManagementRepr.invoke(mailServMBean, "getMailFactoryPropertiesFile", asParam, asSignature); 74 populate(sName, oProps, oForm); 75 } catch (Throwable t) { 76 addGlobalError(t); 77 saveErrors(p_Request, m_Errors); 78 return (p_Mapping.findForward("Global Error")); 79 } 80 81 return (p_Mapping.findForward("MimePart Properties")); 83 } 84 85 } 86 | Popular Tags |