toolbox.web
Class UserInfoFilter

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

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

Filter implementation to obtain user information from a user repository and store the information in an authenticated session.


Constructor Summary
UserInfoFilter()
          Default constructor
 
Method Summary
 void destroy()
          Destroy
 void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)
          If the session is authenticate, populate the configured attribute with user information using the configured service implementation.
 void init(javax.servlet.FilterConfig config)
          Initialise this filter by obtaining the required configuration from the deployment descriptor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserInfoFilter

public UserInfoFilter()
Default constructor

Method Detail

init

public void init(javax.servlet.FilterConfig config)
          throws javax.servlet.ServletException
Initialise this filter by obtaining the required configuration from the deployment descriptor.

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
If the session is authenticate, populate the configured attribute with user information using the configured service implementation.

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