1 16 17 package org.springframework.web.util; 18 19 import java.io.IOException ; 20 21 import javax.servlet.http.HttpServlet ; 22 import javax.servlet.http.HttpServletRequest ; 23 import javax.servlet.http.HttpServletResponse ; 24 25 55 public class Log4jConfigServlet extends HttpServlet { 56 57 public void init() { 58 Log4jWebConfigurer.initLogging(getServletContext()); 59 } 60 61 public void destroy() { 62 Log4jWebConfigurer.shutdownLogging(getServletContext()); 63 } 64 65 66 71 public void service(HttpServletRequest request, HttpServletResponse response) throws IOException { 72 getServletContext().log( 73 "Attempt to call service method on Log4jConfigServlet as [" + 74 request.getRequestURI() + "] was ignored"); 75 response.sendError(HttpServletResponse.SC_BAD_REQUEST); 76 } 77 78 79 public String getServletInfo() { 80 return "Log4jConfigServlet for Servlet API 2.2/2.3 " + 81 "(deprecated in favor of Log4jConfigListener for Servlet API 2.4)"; 82 } 83 84 } 85 | Popular Tags |