org.apache.velocity.tools.view.servlet
Class ServletToolInfo

java.lang.Object
  extended byorg.apache.velocity.tools.view.ViewToolInfo
      extended byorg.apache.velocity.tools.view.servlet.ServletToolInfo
All Implemented Interfaces:
ToolInfo

public class ServletToolInfo
extends ViewToolInfo

ToolInfo implementation that holds scope information for tools used in a servlet environment. The ServletToolboxManager uses this to allow tool definitions to specify the scope/lifecycle of individual view tools.

Example of toolbox.xml definitions for servlet tools:

  <tool>
    <key>link</key>
    <scope>request</scope>
    <class>org.apache.velocity.tools.struts.StrutsLinkTool</class>
  </tool>
  <tool>
    <key>math</key>
    <scope>application</scope>
    <class>org.apache.velocity.tools.generic.MathTool</class>
  </tool>
  <tool>
    <key>user</key>
    <scope>session</scope>
    <class>com.mycompany.tools.MyUserTool</class>
  </tool>
  

Version:
$Id: ServletToolInfo.html,v 1.8.2.1 2004/05/17 17:09:45 nbubna Exp $
Author:
Nathan Bubna

Field Summary
static java.lang.String APPLICATION_SCOPE
          Deprecated. use ViewContext.APPLICATION
static java.lang.String REQUEST_SCOPE
          Deprecated. use ViewContext.REQUEST
private  java.lang.String scope
           
static java.lang.String SESSION_SCOPE
          Deprecated. use ViewContext.SESSION
 
Fields inherited from class org.apache.velocity.tools.view.ViewToolInfo
 
Constructor Summary
ServletToolInfo()
           
 
Method Summary
 java.lang.String getScope()
           
 void setScope(java.lang.String scope)
           
 
Methods inherited from class org.apache.velocity.tools.view.ViewToolInfo
getApplicationClass, getClassname, getInstance, getKey, setClassname, setKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REQUEST_SCOPE

public static final java.lang.String REQUEST_SCOPE
Deprecated. use ViewContext.REQUEST

See Also:
Constant Field Values

SESSION_SCOPE

public static final java.lang.String SESSION_SCOPE
Deprecated. use ViewContext.SESSION

See Also:
Constant Field Values

APPLICATION_SCOPE

public static final java.lang.String APPLICATION_SCOPE
Deprecated. use ViewContext.APPLICATION

See Also:
Constant Field Values

scope

private java.lang.String scope
Constructor Detail

ServletToolInfo

public ServletToolInfo()
Method Detail

setScope

public void setScope(java.lang.String scope)

getScope

public java.lang.String getScope()
Returns:
the scope of the tool


Copyright (c) 2003 Apache Software Foundation