at.spardat.xma.session
Class HashFilter

java.lang.Object
  extended byat.spardat.xma.session.HashFilter
All Implemented Interfaces:
javax.servlet.Filter

public class HashFilter
extends java.lang.Object
implements javax.servlet.Filter

Filters hash values from the URL in the request. A hash value in an URL is defined by the following regular expression: \.[0-9a-f]{32}\. . It consists of 32 hex digits beginning and ending with a dot. It is inserted into the URL by the boot runtime to avoid problems with proxies probably caching wrong versions of the requested file.

Since:
1.6.0

Constructor Summary
HashFilter()
           
 
Method Summary
 void destroy()
          Called by Servlet 2.3 complient web containers to indicate to a filter that it is being taken out of service.
 void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)
          The doFilter method of the Filter is called by the container each time a request/response pair is passed through the chain due to a client request for a resource at the end of the chain.
 java.lang.String filterHash(java.lang.String name)
          Filters hash values from the given string.
 javax.servlet.FilterConfig getFilterConfig()
          Part of Filter Interface contained in weblogic 6.1
 void init(javax.servlet.FilterConfig config)
          Called by Servlet 2.3 complient web containers to indicate to a filter that it is being placed into service.
 void setFilterConfig(javax.servlet.FilterConfig config)
          Called by weblogic 6.1 instead of init().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HashFilter

public HashFilter()
Method Detail

doFilter

public void doFilter(javax.servlet.ServletRequest request,
                     javax.servlet.ServletResponse response,
                     javax.servlet.FilterChain chain)
              throws java.io.IOException,
                     javax.servlet.ServletException
The doFilter method of the Filter is called by the container each time a request/response pair is passed through the chain due to a client request for a resource at the end of the chain. A wrapper is applied to the request and passed on to the next filter or servlet down the chain. This wrapper overriedes all methods returning the request url or parts of it and filters an eventuall hash value.

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

getFilterConfig

public javax.servlet.FilterConfig getFilterConfig()
Part of Filter Interface contained in weblogic 6.1

Returns:
the FilterConfig set by setFilterConfig().

setFilterConfig

public void setFilterConfig(javax.servlet.FilterConfig config)
Called by weblogic 6.1 instead of init().


init

public void init(javax.servlet.FilterConfig config)
          throws javax.servlet.ServletException
Called by Servlet 2.3 complient web containers to indicate to a filter that it is being placed into service. The servlet container calls the init method exactly once after instantiating the filter.

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

destroy

public void destroy()
Called by Servlet 2.3 complient web containers to indicate to a filter that it is being taken out of service. This method is only called once all threads within the filter's doFilter method have exited or after a timeout period has passed. After the web container calls this method, it will not call the doFilter method again on this instance of the filter.

Specified by:
destroy in interface javax.servlet.Filter

filterHash

public java.lang.String filterHash(java.lang.String name)
Filters hash values from the given string. A hash value is defined by the following regular expression: \.[0-9a-f]{32}\. . It consists of 32 hex digits beginning and ending with a dot.

Parameters:
name - the url or part of an url to filter
Returns:
name with the hash-part removed.