EditTopAction.java

00001 
00026 package org.objectweb.jonas.webapp.jonasadmin;
00027 
00028 import java.io.IOException;
00029 import java.util.ArrayList;
00030 
00031 import javax.servlet.ServletException;
00032 import javax.servlet.http.HttpServletRequest;
00033 import javax.servlet.http.HttpServletResponse;
00034 
00035 import org.apache.struts.Globals;
00036 import org.apache.struts.action.ActionErrors;
00037 import org.apache.struts.action.ActionForm;
00038 import org.apache.struts.action.ActionForward;
00039 import org.apache.struts.action.ActionMapping;
00040 import org.objectweb.jonas.jmx.JonasManagementRepr;
00041 
00049 public class EditTopAction extends JonasBaseAction {
00050 
00051 // --------------------------------------------------------- Public Methods
00052 
00068     public ActionForward executeAction(ActionMapping mapping, ActionForm form, HttpServletRequest request
00069         , HttpServletResponse response)
00070         throws IOException, ServletException {
00071 
00072         // Test if force to reload all the frames
00073         ActionErrors oActionErrors = (ActionErrors) request.getAttribute(Globals.ERROR_KEY);
00074         if (oActionErrors != null) {
00075             request.setAttribute("errorServerSelect", new Boolean(true));
00076         }
00077         else {
00078             String sFirstCall = request.getParameter("firstCall");
00079             if (sFirstCall == null) {
00080                 request.setAttribute("reloadAll", new Boolean(true));
00081             }
00082         }
00083 
00084         // Form used
00085         TopForm topFm = new TopForm();
00086         request.setAttribute("topForm", topFm);
00087         try {
00088             topFm.setServerSelect(JonasManagementRepr.getCurrentRMIConnectorName());
00089             ArrayList al = JonasAdminJmx.getListRemoteJonasServerItem(request);
00090             request.setAttribute("serverList", al);
00091         }
00092         catch (Throwable t) {
00093             String message = "Problem when accessing to JOnAS ! : " + t.getMessage();
00094             getServlet().log(message, t);
00095             response.sendError(HttpServletResponse.SC_BAD_REQUEST, message);
00096             return (null);
00097         }
00098 
00099         // Forward to the jsp.
00100         return (mapping.findForward("Top"));
00101     }
00102 
00103 }

Generated on Tue Feb 15 15:05:26 2005 for JOnAS by  doxygen 1.3.9.1