net.spy.jwebkit
Class HeaderFilter

java.lang.Object
  extended by net.spy.SpyObject
      extended by net.spy.jwebkit.HeaderFilter
All Implemented Interfaces:
javax.servlet.Filter

public class HeaderFilter
extends net.spy.SpyObject
implements javax.servlet.Filter

Filter that sets response headers.


Constructor Summary
HeaderFilter()
           
 
Method Summary
 void destroy()
          Destroy this filter.
 void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)
          Add all of the configuration specified headers to the response and then process the rest of the chain.
 void init(javax.servlet.FilterConfig config)
          Load all of the headers from the config.
 
Methods inherited from class net.spy.SpyObject
getLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HeaderFilter

public HeaderFilter()
Method Detail

init

public void init(javax.servlet.FilterConfig config)
          throws javax.servlet.ServletException
Load all of the headers from the config. The headers will be in one of the following forms:
    <init-param>
     <param-name>SomeHeader</param-name>
     <param-value>SomeValue</param-value>
    </init-param>
 
-or-
    <init-param>
     <param-name>SomeHeader:n</param-name>
     <param-value>SomeValue</param-value>
    </init-param>
 
Where n is some arbitrary value that provides uniqueness since the servlet API doesn't allow for duplicate headers.

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

destroy

public void destroy()
Destroy this filter.

Specified by:
destroy in interface javax.servlet.Filter

doFilter

public void doFilter(javax.servlet.ServletRequest request,
                     javax.servlet.ServletResponse response,
                     javax.servlet.FilterChain chain)
              throws java.io.IOException,
                     javax.servlet.ServletException
Add all of the configuration specified headers to the response and then process the rest of the chain.

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


Copyright © 1995-2007 SPY Internetworking. All Rights Reserved.