1 16 package com.blandware.atleap.webapp.servlet; 17 18 import javax.servlet.*; 19 import javax.servlet.http.HttpServlet ; 20 import java.io.IOException ; 21 22 31 public class DefaultServlet extends HttpServlet { 32 33 36 protected static String DISPATCHER_NAME = "default"; 37 38 protected ServletConfig config = null; 39 40 43 public void init(ServletConfig config) throws ServletException { 44 this.config = config; 45 super.init(config); 46 } 47 48 51 public void destroy() { 52 config = null; 53 super.destroy(); 54 } 55 56 74 75 public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException { 76 RequestDispatcher requestDispatcher = config.getServletContext().getNamedDispatcher(DISPATCHER_NAME); 77 requestDispatcher.forward(req, res); 78 } 79 } | Popular Tags |