1 25 26 package org.objectweb.jonas.webapp.jonasadmin; 27 28 import java.io.IOException ; 29 import java.util.ArrayList ; 30 31 import javax.servlet.ServletException ; 32 import javax.servlet.http.HttpServletRequest ; 33 import javax.servlet.http.HttpServletResponse ; 34 35 import org.apache.struts.Globals; 36 import org.apache.struts.action.ActionErrors; 37 import org.apache.struts.action.ActionForm; 38 import org.apache.struts.action.ActionForward; 39 import org.apache.struts.action.ActionMapping; 40 import org.objectweb.jonas.common.Log; 41 import org.objectweb.jonas.jmx.JonasManagementRepr; 42 import org.objectweb.util.monolog.api.BasicLevel; 43 import org.objectweb.util.monolog.api.Logger; 44 45 51 52 public class EditTopAction extends JonasBaseAction { 53 54 56 71 public ActionForward executeAction(ActionMapping mapping, ActionForm form, HttpServletRequest request 72 , HttpServletResponse response) 73 throws IOException , ServletException { 74 75 ActionErrors oActionErrors = (ActionErrors) request.getAttribute(Globals.ERROR_KEY); 77 if (oActionErrors != null) { 78 request.setAttribute("errorServerSelect", new Boolean (true)); 79 } 80 else { 81 String sFirstCall = request.getParameter("firstCall"); 82 if (sFirstCall == null) { 83 request.setAttribute("reloadAll", new Boolean (true)); 84 } 85 } 86 87 TopForm topFm = new TopForm(); 89 request.setAttribute("topForm", topFm); 90 try { 91 topFm.setServerSelect(JonasManagementRepr.getCurrentRMIConnectorName()); 92 ArrayList al = JonasAdminJmx.getListRemoteJonasServerItem(request); 93 request.setAttribute("serverList", al); 94 } 95 catch (Throwable t) { 96 String message = "Problem when accessing to JOnAS ! : " + t.getMessage(); 97 Logger logger = Log.getLogger(Log.JONAS_ADMIN_PREFIX); 99 if (logger.isLoggable(BasicLevel.DEBUG)) { 100 logger.log(BasicLevel.DEBUG, message); 101 } 102 response.sendError(HttpServletResponse.SC_BAD_REQUEST, message); 103 return (null); 104 } 105 106 return (mapping.findForward("Top")); 108 } 109 110 } 111 | Popular Tags |