com.esri.adf.web.util
Class ADFSessionTimeoutFilter

java.lang.Object
  extended bycom.esri.adf.web.util.ADFSessionTimeoutFilter
All Implemented Interfaces:
javax.servlet.Filter

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

A servlet filter which checks if the session has timed out or not. If it has timed out, then it redirects to the page specified by the "redirectPage" init parameter in the web.xml file.


Field Summary
static java.lang.String ADF_POST_BACK_PARAMETER_NAME
          The ADF postback parameter name.
static java.lang.String CHARACTER_ENCODING_PARAMETER_NAME
          The parameter name for the character encoding.
static java.lang.String DEFAULT_CHARACTER_ENCODING
          Default character encoding UTF-8.
static java.lang.String REDIRECT_PAGE_PARAMETER_NAME
          The parameter name for the page to redirect to if the session has timed out.
 
Constructor Summary
ADFSessionTimeoutFilter()
           
 
Method Summary
 void destroy()
          Destroys the filter.
 void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)
          The filter determines whether to continue normal processing for new sessions and valid sessions.
 void init(javax.servlet.FilterConfig filterConfig)
          Initializes the filter by retrieving the values for "redirectPage" and "characterEncoding"
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REDIRECT_PAGE_PARAMETER_NAME

public static final java.lang.String REDIRECT_PAGE_PARAMETER_NAME
The parameter name for the page to redirect to if the session has timed out.

See Also:
Constant Field Values

ADF_POST_BACK_PARAMETER_NAME

public static final java.lang.String ADF_POST_BACK_PARAMETER_NAME
The ADF postback parameter name. The filter checks for this parameter to determine if the request came from an ADF page.

See Also:
Constant Field Values

CHARACTER_ENCODING_PARAMETER_NAME

public static final java.lang.String CHARACTER_ENCODING_PARAMETER_NAME
The parameter name for the character encoding.

See Also:
Constant Field Values

DEFAULT_CHARACTER_ENCODING

public static final java.lang.String DEFAULT_CHARACTER_ENCODING
Default character encoding UTF-8.

See Also:
Constant Field Values
Constructor Detail

ADFSessionTimeoutFilter

public ADFSessionTimeoutFilter()
Method Detail

init

public void init(javax.servlet.FilterConfig filterConfig)
          throws javax.servlet.ServletException
Initializes the filter by retrieving the values for "redirectPage" and "characterEncoding"

Specified by:
init in interface javax.servlet.Filter
Parameters:
filterConfig - the filter configuration
Throws:
javax.servlet.ServletException

doFilter

public void doFilter(javax.servlet.ServletRequest request,
                     javax.servlet.ServletResponse response,
                     javax.servlet.FilterChain chain)
              throws java.io.IOException,
                     javax.servlet.ServletException
The filter determines whether to continue normal processing for new sessions and valid sessions. Redirects to a "redirectPage" if the session has timed out.

Specified by:
doFilter in interface javax.servlet.Filter
Parameters:
request - the servlet request
response - the servlet response
chain - the servlet filter chain
Throws:
java.io.IOException
javax.servlet.ServletException

destroy

public void destroy()
Destroys the filter.

Specified by:
destroy in interface javax.servlet.Filter