import javax.servlet.*;
public class MessageFilter implements Filter { 
  private FilterConfig filterConfig; 
  public void doFilter(final ServletRequest request,
                       final ServletResponse response,
                       FilterChain chain)
       throws java.io.IOException, javax.servlet.ServletException { 

    System.out.println("Entering MessageFilter");
    String message = filterConfig.getInitParameter("message");
    request.setAttribute("message",message);
    chain.doFilter(request,response);
    System.out.println("Exiting MessageFilter"); 
  } 
  public void init(final FilterConfig filterConfig) {            
    this.filterConfig = filterConfig;
  } 
  public void destroy() {                                                  
  }
}
