org.apache.taglibs.velocity
Class ScopeTool

java.lang.Object
  extended by org.apache.taglibs.velocity.ScopeTool

public class ScopeTool
extends java.lang.Object

Simple context tool to allow a template-in-JSP to access the scopes directly to retrieve objects/beans.

Version:
$Id: ScopeTool.java 516448 2007-03-09 16:25:47Z ate $
Author:
Geir Magnusson Jr.

Field Summary
protected  javax.servlet.jsp.PageContext pageContext
           
 
Constructor Summary
ScopeTool(javax.servlet.jsp.PageContext pageContext)
           
 
Method Summary
 java.lang.Object getAnyScope(java.lang.String name)
          retrieves a named object from anyscope, working 'upwards': page - > request - > session - > application
 java.lang.Object getApplicationScope(java.lang.String name)
          retrieves an object from the application scope
 java.lang.Object getPageScope(java.lang.String name)
          retrieves an object from the page scope
 java.lang.Object getRequestScope(java.lang.String name)
          retrieves an object from the request scope
 java.lang.Object getSessionScope(java.lang.String name)
          retrieves an object from the session scope
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pageContext

protected javax.servlet.jsp.PageContext pageContext
Constructor Detail

ScopeTool

public ScopeTool(javax.servlet.jsp.PageContext pageContext)
Method Detail

getPageScope

public java.lang.Object getPageScope(java.lang.String name)
retrieves an object from the page scope

Parameters:
name - Name of object in scope
Returns:
object if found, null otherwise

getRequestScope

public java.lang.Object getRequestScope(java.lang.String name)
retrieves an object from the request scope

Parameters:
name - Name of object in scope
Returns:
object if found, null otherwise

getSessionScope

public java.lang.Object getSessionScope(java.lang.String name)
retrieves an object from the session scope

Parameters:
name - Name of object in scope
Returns:
object if found, null otherwise

getApplicationScope

public java.lang.Object getApplicationScope(java.lang.String name)
retrieves an object from the application scope

Parameters:
name - Name of object in scope
Returns:
object if found, null otherwise

getAnyScope

public java.lang.Object getAnyScope(java.lang.String name)
retrieves a named object from anyscope, working 'upwards': page - > request - > session - > application

Parameters:
name - Name of object in scope
Returns:
object if found, null otherwise


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