Filter Using Parameter : Filter « Servlets « Java






Filter Using Parameter

 

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public final class FilterParameter implements Filter 
{
  private FilterConfig filterConfig = null;

  public void doFilter(ServletRequest request, ServletResponse response,
    FilterChain chain)
    throws IOException, ServletException 
  {

    System.out.println("The message is: " + filterConfig.getInitParameter("message"));
    chain.doFilter(request, response);
  }

  public void destroy() { }

  public void init(FilterConfig filterConfig) {
    this.filterConfig = filterConfig;
  }
}

           
         
  








FilterUsingParameter.zip( 89 k)

Related examples in the same category

1.Filtering page to UTF-8
2.Response Filter
3.Servlets Post Filter Demo
4.Servlets Logging Filter Demo
5.Another Filter Demo
6.Servlets CSV Filter Demo
7.Servlets SortFilter Demo
8.Jsp Using Chained Filter
9.Logging Filter
10.Restricting Filter
11.Filter that performs filtering based on comparing the appropriate request
12.JNDI Filter
13.Email JNDI Filter
14.Send filter
15.Log Filter
16.IP Filter
17.Block Filter
18.Checker Filter
19.Servlet : session filter
20.Parameter Filter
21.HTML filter utility
22.Compression Filter
23.Request Filter
24.Filter message string for characters that are sensitive in HTML
25.Filter that wraps an HttpServletRequest to override "isUserInRole".
26.Filter the specified message string for characters that are sensitive in HTML
27.Cache Filter