1 16 17 18 package org.apache.webapp.admin; 19 20 21 import java.io.IOException ; 22 import java.io.PrintWriter ; 23 import java.util.Arrays ; 24 import javax.servlet.ServletException ; 25 import javax.servlet.http.HttpServletRequest ; 26 import javax.servlet.http.HttpServletResponse ; 27 import javax.servlet.http.HttpSession ; 28 import org.apache.commons.modeler.ManagedBean; 29 import org.apache.commons.modeler.Registry; 30 import org.apache.struts.action.Action; 31 import org.apache.struts.action.ActionErrors; 32 import org.apache.struts.action.ActionForm; 33 import org.apache.struts.action.ActionForward; 34 import org.apache.struts.action.ActionMapping; 35 36 37 44 45 public final class DumpRegistryAction extends Action { 46 47 48 50 51 66 public ActionForward execute(ActionMapping mapping, 67 ActionForm form, 68 HttpServletRequest request, 69 HttpServletResponse response) 70 throws IOException , ServletException { 71 72 Registry registry = ((ApplicationServlet) getServlet()).getRegistry(); 74 String names[] = registry.findManagedBeans(); 75 Arrays.sort(names); 76 ManagedBean beans[] = new ManagedBean[names.length]; 77 for (int i = 0; i < names.length; i++) 78 beans[i] = registry.findManagedBean(names[i]); 79 request.setAttribute("beans", beans); 80 81 return (mapping.findForward("Dump Registry Results")); 83 84 } 85 86 87 } 88 | Popular Tags |