package com.wolf.pub;
/**
* Created by IntelliJ IDEA.
* User: user
* Date: 2008-4-10
* Time: 9:07:30
* To change this template use File | Settings | File Templates.
*/
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.Date; // For Date class
/** Simple filter that prints a report on the standard output
* each time an associated servlet or JSP page is accessed.
*/
public class ReportFilter implements Filter {
public void doFilter(ServletRequest request,
ServletResponse response,
FilterChain chain)
throws ServletException, IOException {
HttpServletRequest req = (HttpServletRequest)request;
System.out.println(req.getRemoteHost() +
" tried to access " +
req.getRequestURL() +
" on " + new Date() + ".");
chain.doFilter(request,response);
}
public void init(FilterConfig config)
throws ServletException {
}
public void destroy() {}
}