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

| WrapperSample.java |

    1 package tw.com.javaworld.CH11;
    2
    3 import javax.servlet.*;
    4 import javax.servlet.http.*;
    5 public class WrapperSample implements Filter {
    6
    7     public void doFilter(
    8         ServletRequest request,
    9         ServletResponse response,
    10        FilterChain chain) {
    11        try {
    12            RequestWrapperSample wrapper =
    13                new RequestWrapperSample((HttpServletRequest) request);
    14            chain.doFilter(wrapper, response);
    15        } catch (Exception e) {
    16        }
    17    }
    18
    19    public void init(FilterConfig config) throws ServletException {
    20    }
    21
    22    public void destroy() {
    23    }
    24}