1 package org.jfox.ioc.management.http; 2 3 import javax.servlet.http.HttpServletRequest ; 4 5 import org.apache.velocity.context.Context; 6 import org.jfox.ioc.Component; 7 import org.jfox.ioc.ComponentMeta; 8 import org.jfox.ioc.ComponentName; 9 10 13 14 public class InstantiateServlet extends SuperServlet { 15 16 public String getTemplate() { 17 return "instantiate.vm"; 18 } 19 20 public void buildContext(HttpServletRequest request, Context ctx) throws Exception { 21 String _componentName = request.getParameter("componentname"); 22 ComponentName componentName = ComponentName.parseString(_componentName,getRegistry().getClassLoaderRepository()); 23 24 ComponentMeta meta = getRegistry().getComponentMeta(componentName); 25 Component component = getRegistry().getComponentInstance(componentName); 26 27 ctx.put("title","Instantiate Result View"); 28 ctx.put("componentName",_componentName); 29 ctx.put("description",meta.getDescription()); 30 ctx.put("component",component); 31 32 } 33 34 public static void main(String [] args) { 35 36 } 37 } 38 39 | Popular Tags |