tw.com.javaworld.CH11.HelloFilter (Java2HTML)

| HelloFilter.java |

    1 package tw.com.javaworld.CH11;
    2
    3 import java.io.*;
    4 import javax.servlet.*;
    5 import javax.servlet.http.*;
    6
    7 public class HelloFilter implements Filter {
    8
    9     public void init(FilterConfig config) throws ServletException {
    10    }
    11
    12    public void doFilter(
    13        ServletRequest request,
    14        ServletResponse response,
    15        FilterChain chain)
    16        throws IOException, ServletException {
    17
    18        System.out.println("Hello Filter !!");
    19        chain.doFilter(request, response);
    20    }
    21
    22    public void destroy() {
    23    }
    24}