com.esri.adf.web.util
Class ADFSessionTimeoutFilter

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

public class ADFSessionTimeoutFilter
extends 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 String ADF_POST_BACK_PARAMETER_NAME
          The ADF postback parameter name.
static String CHARACTER_ENCODING_PARAMETER_NAME
          The parameter name for the character encoding.
static String DEFAULT_CHARACTER_ENCODING
          Default character encoding UTF-8.
static String ERROR_PAGE_PARAMETER_NAME
          The parameter name for the page to redirect to if the session has been invalidated due to error.
static 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 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

ERROR_PAGE_PARAMETER_NAME

public static final String ERROR_PAGE_PARAMETER_NAME
The parameter name for the page to redirect to if the session has been invalidated due to error.

See Also:
Constant Field Values

ADF_POST_BACK_PARAMETER_NAME

public static final 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 String CHARACTER_ENCODING_PARAMETER_NAME
The parameter name for the character encoding.

See Also:
Constant Field Values

DEFAULT_CHARACTER_ENCODING

public static final 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)
Initializes the filter by retrieving the values for "redirectPage" and "characterEncoding"

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

doFilter

public void doFilter(javax.servlet.ServletRequest request,
                     javax.servlet.ServletResponse response,
                     javax.servlet.FilterChain chain)
              throws 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:
IOException
javax.servlet.ServletException

destroy

public void destroy()
Destroys the filter.

Specified by:
destroy in interface javax.servlet.Filter