net.sourceforge.scopes.click
Class ClickScopeManager

java.lang.Object
  extended by net.sourceforge.scopes.click.ClickScopeManager
All Implemented Interfaces:
ScopeManager<javax.servlet.http.HttpServletRequest>

public class ClickScopeManager
extends java.lang.Object
implements ScopeManager<javax.servlet.http.HttpServletRequest>

Manages the click scope. The "click" scope is like the "request" scope, with the difference that it is persistent across redirections.
To accomplish it, this scope manager moves the context from request in session scope temporarily when a redirection is made, and rewrites the URL with a cookie parameter that identifies the context itself. Once a new request is made (the one after the redirection) the context is moved back from session to request scope.


Nested Class Summary
protected  class ClickScopeManager.ClickContext
          This class represents a "click" context.
 
Constructor Summary
ClickScopeManager()
           
 
Method Summary
 void configure(java.lang.String scopeName, java.util.Map<java.lang.String,java.lang.Object> parameters)
          Configures the scope manager before its real use.
 Context createContext(javax.servlet.http.HttpServletRequest request)
          Creates a context, given the request.
static ClickScopeManager.ClickContext findContext(javax.servlet.http.HttpServletRequest request)
          Finds a ClickContext in request scope.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClickScopeManager

public ClickScopeManager()
Method Detail

findContext

public static ClickScopeManager.ClickContext findContext(javax.servlet.http.HttpServletRequest request)
Finds a ClickContext in request scope. There should be only one.

Parameters:
request - The HTTP request.
Returns:
The click context.

configure

public void configure(java.lang.String scopeName,
                      java.util.Map<java.lang.String,java.lang.Object> parameters)
Description copied from interface: ScopeManager
Configures the scope manager before its real use.

Specified by:
configure in interface ScopeManager<javax.servlet.http.HttpServletRequest>
Parameters:
scopeName - The scope name.
parameters - The map of parameters used to configure it.

createContext

public Context createContext(javax.servlet.http.HttpServletRequest request)
Description copied from interface: ScopeManager
Creates a context, given the request.

Specified by:
createContext in interface ScopeManager<javax.servlet.http.HttpServletRequest>
Parameters:
request - The request to use.
Returns:
The created context.