1 20 package org.apache.cactus.server; 21 22 import javax.servlet.ServletException ; 23 import javax.servlet.http.HttpServlet ; 24 import javax.servlet.http.HttpServletRequest ; 25 import javax.servlet.http.HttpServletResponse ; 26 27 import org.apache.cactus.internal.configuration.ConfigurationInitializer; 28 import org.apache.cactus.internal.server.ServletImplicitObjects; 29 import org.apache.cactus.internal.server.ServletTestController; 30 import org.apache.commons.logging.Log; 31 import org.apache.commons.logging.LogFactory; 32 33 39 public class ServletTestRedirector extends HttpServlet 40 { 41 48 static 49 { 50 ConfigurationInitializer.initialize(); 51 } 52 53 56 private static final Log LOGGER = 57 LogFactory.getLog(ServletTestRedirector.class); 58 59 68 public void doGet(HttpServletRequest theRequest, 69 HttpServletResponse theResponse) throws ServletException 70 { 71 doPost(theRequest, theResponse); 73 } 74 75 85 public void doPost(HttpServletRequest theRequest, 86 HttpServletResponse theResponse) throws ServletException 87 { 88 LOGGER.debug("------------- Start Servlet service"); 90 91 ServletImplicitObjects objects = new ServletImplicitObjects(); 93 94 objects.setHttpServletRequest(theRequest); 95 objects.setHttpServletResponse(theResponse); 96 objects.setServletContext(getServletContext()); 97 objects.setServletConfig(getServletConfig()); 98 99 ServletTestController controller = new ServletTestController(); 100 101 controller.handleRequest(objects); 102 } 103 } 104 | Popular Tags |