com.bea.p13n.servlets
Class NullFilter

java.lang.Object
  extended by com.bea.p13n.servlets.NullFilter
All Implemented Interfaces
javax.servlet.Filter

public class NullFilter
extends Object
implements javax.servlet.Filter

This filter does nothing. The only reason you might need such a thing is to override a filter that has been deployed in a Library Module. Due to the way descriptor merging works for web.xml, you can not "turn off" a filter which is deployed in a library's web.xml. There is not anything available in your web app's web.xml to turn such a filter off. Therefore, the only thing you can do is override the filter with one that does nothing (that is why this filter exists).

For example, maybe a library module contains a filter such as:

    <filter>
      <filter-name>SomeFilter</filter-name>
      <filter-class>org.foo.TheFilter</filter-class>
    </filter>
 
You can override this in your application's web.xml using the same filter-name, like this:
    <filter>
      <filter-name>SomeFilter</filter-name>
      <filter-class>com.bea.p13n.servlets.NullFilter</filter-class>
    </filter>
 


Constructor Summary
NullFilter()
           
 
Method Summary
 void destroy()
          does nothing
 void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)
          Simply calls chain.doFilter(request,response).
 void init(javax.servlet.FilterConfig config)
          does nothing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullFilter

public NullFilter()
Method Detail

doFilter

public void doFilter(javax.servlet.ServletRequest request,
                     javax.servlet.ServletResponse response,
                     javax.servlet.FilterChain chain)
              throws IOException,
                     javax.servlet.ServletException
Simply calls chain.doFilter(request,response).

Specified by:
doFilter in interface javax.servlet.Filter
Throws
IOException
javax.servlet.ServletException

init

public void init(javax.servlet.FilterConfig config)
          throws javax.servlet.ServletException
does nothing

Specified by:
init in interface javax.servlet.Filter
Throws
javax.servlet.ServletException

destroy

public void destroy()
does nothing

Specified by:
destroy in interface javax.servlet.Filter


Copyright © 2011, Oracle. All rights reserved.