|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.velocity.context.InternalContextBase | +--org.apache.velocity.context.AbstractContext | +--org.apache.velocity.VelocityContext | +--org.apache.velocity.tools.view.context.ChainedContext
Velocity context implementation specific to the Servlet environment.
It provides the following special features:
The internalGet(String key)
method implements the following search order
for objects:
The purpose of this class is to make it easy for web designer to work with Java servlet based web applications. They do not need to be concerned with the concepts of request, session or application attributes and the lifetime of objects in these scopes.
Note that the put() method always puts objects into the local hashtable.
Field Summary | |
private javax.servlet.ServletContext |
application
A local reference to the servlet context. |
static java.lang.String |
APPLICATION
Key to the servlet context object. |
private javax.servlet.http.HttpServletRequest |
request
A local reference to the current servlet request. |
static java.lang.String |
REQUEST
Key to the HTTP request object. |
private javax.servlet.http.HttpServletResponse |
response
A local reference to the current servlet response. |
static java.lang.String |
RESPONSE
Key to the HTTP response object. |
private javax.servlet.http.HttpSession |
session
A local reference to the servlet session. |
static java.lang.String |
SESSION
Key to the HTTP session object. |
private ToolboxContext |
toolboxContext
The toolbox. |
Fields inherited from class org.apache.velocity.VelocityContext |
|
Fields inherited from class org.apache.velocity.context.AbstractContext |
|
Constructor Summary | |
ChainedContext(org.apache.velocity.context.Context ctx,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.ServletContext application)
Default constructor. |
Method Summary | |
javax.servlet.http.HttpServletRequest |
getRequest()
Returns the current servlet request. |
javax.servlet.http.HttpServletResponse |
getResponse()
Returns the current servlet response. |
javax.servlet.ServletContext |
getServletContext()
Returns the servlet context. |
org.apache.velocity.context.Context |
getVelocityContext()
Returns a reference to the Velocity context (this object). |
java.lang.Object |
internalGet(java.lang.String key)
Looks up and returns the object with the specified key. |
void |
setToolbox(ToolboxContext box)
Sets the toolbox of view tools. |
Methods inherited from class org.apache.velocity.VelocityContext |
clone, internalContainsKey, internalGetKeys, internalPut, internalRemove |
Methods inherited from class org.apache.velocity.context.AbstractContext |
attachEventCartridge, containsKey, get, getChainedContext, getCurrentResource, getCurrentTemplateName, getEventCartridge, getKeys, getTemplateNameStack, icacheGet, icachePut, popCurrentTemplateName, pushCurrentTemplateName, put, remove, setCurrentResource |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private javax.servlet.http.HttpServletRequest request
private javax.servlet.http.HttpServletResponse response
private javax.servlet.http.HttpSession session
private javax.servlet.ServletContext application
private ToolboxContext toolboxContext
public static final java.lang.String REQUEST
public static final java.lang.String RESPONSE
public static final java.lang.String SESSION
public static final java.lang.String APPLICATION
Constructor Detail |
public ChainedContext(org.apache.velocity.context.Context ctx, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.ServletContext application)
Method Detail |
public void setToolbox(ToolboxContext box)
Sets the toolbox of view tools.
box
- toolbox of view toolspublic java.lang.Object internalGet(java.lang.String key)
Looks up and returns the object with the specified key.
See the class documentation for more details.
internalGet
in class org.apache.velocity.VelocityContext
key
- the key of the object requested
public javax.servlet.http.HttpServletRequest getRequest()
Returns the current servlet request.
getRequest
in interface ViewContext
public javax.servlet.http.HttpServletResponse getResponse()
Returns the current servlet response.
getResponse
in interface ViewContext
public javax.servlet.ServletContext getServletContext()
Returns the servlet context.
getServletContext
in interface ViewContext
public org.apache.velocity.context.Context getVelocityContext()
Returns a reference to the Velocity context (this object).
getVelocityContext
in interface ViewContext
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |