Thread: [Ejtools-cvs] applications/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/web/action View
Brought to you by:
letiemble
Update of /cvsroot/ejtools/applications/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/web/action In directory usw-pr-cvs1:/tmp/cvs-serv18235/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/web/action Modified Files: DetailAction.java Added Files: ViewAction.java Removed Files: ConnectAction.java Log Message: Basic Web App --- NEW FILE: ViewAction.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package net.sourceforge.ejtools.jndibrowser.web.action; import java.io.IOException; import java.util.Locale; import javax.servlet.ServletContext; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import net.sourceforge.ejtools.jndibrowser.model.Server; import net.sourceforge.ejtools.jndibrowser.web.Constants; import net.sourceforge.ejtools.jndibrowser.web.JNDIContainer; import org.apache.log4j.Category; import org.apache.struts.action.Action; import org.apache.struts.action.ActionErrors; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.apache.struts.util.MessageResources; /** * Description of the Class * * @author letiemble * @created 12 novembre 2001 * @todo Javadoc to complete */ public class ViewAction extends Action { /** Description of the Field */ private static Category logger = Category.getInstance(ViewAction.class.getName()); /** Constructor for the ViewAction object */ public ViewAction() { } /** * 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 { JNDIContainer javaTree = null; JNDIContainer globalTree = null; // Extract attributes we will need Locale locale = getLocale(request); MessageResources messages = getResources(); // Validate the request parameters specified by the user ActionErrors errors = new ActionErrors(); logger.debug("Connecting to JNDI..."); // Report any errors we have discovered back to the original form if (!errors.empty()) { saveErrors(request, errors); return (new ActionForward(mapping.getInput())); } ServletContext context = this.getServlet().getServletContext(); javaTree = (JNDIContainer) context.getAttribute(Constants.JAVA_TREE); globalTree = (JNDIContainer) context.getAttribute(Constants.GLOBAL_TREE); if (javaTree == null) { javaTree = new JNDIContainer(); javaTree.setContext("java:"); context.setAttribute(Constants.JAVA_TREE, javaTree); } if (globalTree == null) { globalTree = new JNDIContainer(); globalTree.setContext(""); context.setAttribute(Constants.GLOBAL_TREE, globalTree); } String search = request.getParameter("search"); if ("D".equals(search)) { javaTree.setSearchType(Server.DEEP_SEARCH); globalTree.setSearchType(Server.DEEP_SEARCH); } else { javaTree.setSearchType(Server.SHALLOW_SEARCH); globalTree.setSearchType(Server.SHALLOW_SEARCH); } javaTree.refresh(); globalTree.refresh(); return (mapping.findForward("view")); } } Index: DetailAction.java =================================================================== RCS file: /cvsroot/ejtools/applications/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/web/action/DetailAction.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DetailAction.java 25 May 2002 20:54:02 -0000 1.2 --- DetailAction.java 30 May 2002 22:37:54 -0000 1.3 *************** *** 103,107 **** context.setAttribute(Constants.DETAIL_INFO, info); System.out.println("Info " + info); ! BeanDescriptor descriptor = info.getBeanDescriptor(); context.setAttribute(Constants.DETAIL_INFO_DESCRIPTOR, descriptor); --- 103,107 ---- context.setAttribute(Constants.DETAIL_INFO, info); System.out.println("Info " + info); ! BeanDescriptor descriptor = info.getBeanDescriptor(); context.setAttribute(Constants.DETAIL_INFO_DESCRIPTOR, descriptor); --- ConnectAction.java DELETED --- |