toolbox.web
Class AuthedFilter

Package class diagram package AuthedFilter
java.lang.Object
  extended by toolbox.web.AuthedFilter
All Implemented Interfaces:
javax.servlet.Filter

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

Filter implementation to verify that requests are made as part of an authenticated session.


Constructor Summary
AuthedFilter()
          Default constructor
 
Method Summary
 void destroy()
          Destroy
 void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)
          Check the current session to see if it is an authenticated session.
 void init(javax.servlet.FilterConfig config)
          Initialise this filter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthedFilter

public AuthedFilter()
Default constructor

Method Detail

init

public void init(javax.servlet.FilterConfig config)
          throws javax.servlet.ServletException
Initialise this filter.

Read configuration properties.

Specified by:
init in interface javax.servlet.Filter
Parameters:
config - Filter configuration.
Throws:
javax.servlet.ServletException - if filter cannot be initialised.

doFilter

public void doFilter(javax.servlet.ServletRequest request,
                     javax.servlet.ServletResponse response,
                     javax.servlet.FilterChain chain)
              throws javax.servlet.ServletException,
                     java.io.IOException
Check the current session to see if it is an authenticated session.

The check is not performed if this is a request to access the login page.

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

destroy

public void destroy()
Destroy

Specified by:
destroy in interface javax.servlet.Filter