org.apache.turbine.modules.actions.sessionvalidator
Class DefaultSessionValidator

java.lang.Object
  |
  +--org.apache.turbine.modules.Assembler
        |
        +--org.apache.turbine.modules.Action
              |
              +--org.apache.turbine.modules.actions.sessionvalidator.SessionValidator
                    |
                    +--org.apache.turbine.modules.actions.sessionvalidator.DefaultSessionValidator

public class DefaultSessionValidator
extends SessionValidator

The SessionValidator attempts to retrieve the User object from the Servlet API session that is associated with the request. If the data cannot be retrieved, it is handled here. If the user has not been marked as being logged into the system, the user is rejected and the screen is set to the screen.homepage value in TurbineResources.properties.

Other systems generally have a database table which stores this information, but we take advantage of the Servlet API here to save a hit to the database for each and every connection that a user makes.

This action is special in that it should only be executed by the Turbine servlet.

Version:
$Id$
Author:
Dave Bryson

Constructor Summary
DefaultSessionValidator()
           
 
Method Summary
 void doPerform(RunData data)
          Execute the action.
 boolean requiresNewSession(RunData data)
          By default, this is true.
 
Methods inherited from class org.apache.turbine.modules.Action
perform
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Constructor Detail

DefaultSessionValidator

public DefaultSessionValidator()
Method Detail

doPerform

public void doPerform(RunData data)
               throws java.lang.Exception
Execute the action.
Overrides:
doPerform in class Action
Parameters:
data - Turbine information.
Throws:
Exception, - a generic exception.

requiresNewSession

public boolean requiresNewSession(RunData data)
By default, this is true. It says that we require a new session in order to allow people to access the system. We accomplish this by doing a redirect and using the HttpSession spec.
Overrides:
requiresNewSession in class SessionValidator
Parameters:
data - Turbine information.
Returns:
True if we require a new session in order to allow people to access the system.


Copyright © 1999-2001 Apache Software Foundation. All Rights Reserved.