1 22 package com.geinuke.servlet; 23 import java.util.Locale ; 24 25 import javax.servlet.http.HttpServletRequest ; 26 import javax.servlet.http.HttpServletResponse ; 27 28 import org.apache.velocity.context.Context; 29 import org.apache.velocity.tools.generic.RenderTool; 30 31 import com.geinuke.util.NukeResource; 32 import com.magic.servlet.ControllerMagicServlet; 33 import com.magic.servlet.action.MagicAction; 34 public class InstallServlet extends ControllerMagicServlet{ 35 protected String getTemplateString( 36 Context context, 37 HttpServletRequest req, 38 HttpServletResponse res) throws Exception { 39 String ris=null; 40 String name=this.getRelativePath(req); 41 log(name); 42 43 String className=(String )this.initParameter.get(name); 44 Class c=Class.forName(className); 45 Object o=c.newInstance(); 46 MagicAction ac=(MagicAction)(o); 47 ac.setRefName(name); 48 ac.setServlet(this); 49 ris=ac.handleAction(req,res,context); 50 51 52 return ris; 53 54 55 } 56 57 protected String chooseTemplateString( 58 Context context, 59 HttpServletRequest req, 60 HttpServletResponse res) throws Exception { 61 long start=System.currentTimeMillis(); 62 String ris=null; 63 ris=this.getTemplateString(context,req,res); 64 return ris; 65 } 66 67 } 68 | Popular Tags |