1 25 26 package org.objectweb.jonas.webapp.jonasadmin.logging; 27 28 import java.io.IOException ; 29 import java.util.ArrayList ; 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.webapp.jonasadmin.JonasBaseAction; 40 import org.objectweb.jonas.webapp.jonasadmin.common.ItemsForm; 41 42 45 public class ApplyLoggersAction extends JonasBaseAction { 46 47 49 public ActionForward executeAction(ActionMapping p_Mapping, ActionForm p_Form 50 , HttpServletRequest p_Request, HttpServletResponse p_Response) 51 throws IOException , ServletException { 52 53 ItemsForm oForm = (ItemsForm) p_Form; 55 56 try { 58 ArrayList alSelected = new ArrayList (); 60 ObjectName on; 61 for (int i = 0; i < oForm.getSelectedItemsArray().length; i++) { 62 String selectedItem = oForm.getSelectedItemsArray()[i]; 63 String hostName = ObjectName.getInstance(selectedItem).getKeyProperty("host"); 64 String containerName = null; 65 String type = null; 66 String containerType = null; 67 if (hostName == null) { 68 type = LoggerItem.LOGGER_CATALINA_ACCESS_ENGINE; 69 containerType = m_Resources.getMessage("label.loggers.container.engine"); 70 } else { 71 type = LoggerItem.LOGGER_CATALINA_ACCESS_HOST; 72 containerName = hostName; 75 containerType = m_Resources.getMessage("label.loggers.container.host"); 76 } 77 alSelected.add(new LoggerItem(m_Resources.getMessage("logger.catalina.access.name") 78 , type, null, selectedItem, containerType, containerName)); 79 } 80 oForm.setSelectedItemsList(alSelected); 81 } 82 catch (Throwable t) { 83 addGlobalError(t); 84 saveErrors(p_Request, m_Errors); 85 return (p_Mapping.findForward("Global Error")); 86 } 87 88 return p_Mapping.findForward("Loggers Confirm"); 90 } 91 } 92 | Popular Tags |