import java.util.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.security.*;
public class MyServlet implements Filter
{
private FilterConfig filterConfig = null;
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain)
throws IOException, ServletException
{
chain.doFilter(request, response);
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("The filter got this message: " + filterConfig.getInitParameter("message"));
}
public void destroy() { }
public void init(FilterConfig filterConfig) {
this.filterConfig = filterConfig;
}
}
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
Simple Filter
MyServlet
message
Hello!
Simple Filter
/*