[Ejtools-cvs] CVS: applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/web/action D
Brought to you by:
letiemble
From: Laurent E. <let...@us...> - 2002-04-24 20:33:52
|
Update of /cvsroot/ejtools/applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/web/action In directory usw-pr-cvs1:/tmp/cvs-serv29407/main/net/sourceforge/ejtools/jmxbrowser/web/action Added Files: DetailAction.java Log Message: Initial Import --- NEW FILE: DetailAction.java --- package net.sourceforge.ejtools.jmxbrowser.web.action; import java.io.*; import java.sql.*; import java.util.*; import javax.ejb.*; import javax.management.*; import javax.management.j2ee.*; import javax.naming.*; import javax.rmi.*; import javax.servlet.*; import javax.servlet.http.*; import javax.sql.*; import net.sourceforge.ejtools.jmxbrowser.model.*; import net.sourceforge.ejtools.jmxbrowser.web.*; import org.apache.log4j.*; import org.apache.struts.action.*; import org.apache.struts.util.*; /** * Description of the Class * * @author letiembl * @created 12 novembre 2001 */ public class DetailAction extends Action { /** Description of the Field */ private static Category cat = Category.getInstance(DetailAction.class.getName()); /** Constructor for the SearchLoginAction object */ public DetailAction() { } /** * Description of the Method * * @param mapping Description of Parameter * @param form Description of Parameter * @param request Description of Parameter * @param response Description of Parameter * @return Description of the Returned Value * @exception IOException Description of Exception * @exception ServletException Description of Exception */ public ActionForward perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { // Extract attributes we will need Locale locale = getLocale(request); MessageResources messages = getResources(); // Validate the request parameters specified by the user ActionErrors errors = new ActionErrors(); // TODO : put in Constants String ref = request.getParameter("reference"); System.out.println("REF " + ref); HttpSession session = request.getSession(); System.out.println("perform session "+session.getId()); System.out.println("Session " + session); JMXTree root = (JMXTree) session.getAttribute(Constants.TREE); System.out.println("Root " + root); Resource o = (Resource) root.searchObjectName(ref); if (o != null) { session.setAttribute(Constants.DETAIL, o); System.out.println("Object " + o); session.setAttribute(Constants.DETAIL_INFO, o.getMBeanInfo()); System.out.println("Object " + o.getMBeanInfo()); } else { errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("error.cannot.connect")); } // Report any errors we have discovered back to the original form if (!errors.empty()) { saveErrors(request, errors); return (mapping.findForward("error")); } return (mapping.findForward("detail")); } } |