public interface ViewContext
This interface provides view tools in a servlet environment access to relevant context information, like servlet request, servlet context and the velocity context.
The standard implementation is ViewToolContext
.
Modifier and Type | Field and Description |
---|---|
static String |
APPLICATION
Key used for the servlet context object in templates.
|
static String |
DEFAULT_TOOLBOX_KEY
Default key used to store toolboxes in request/session/application attributes.
|
static String |
REQUEST
Key used for the HTTP request object.
|
static String |
RESPONSE
Key used for the HTTP response object.
|
static String |
SERVLET_CONTEXT_KEY
Key used for the servlet context object in tool properties.
|
static String |
SESSION
Key used for the HTTP session object.
|
Modifier and Type | Method and Description |
---|---|
Object |
getAttribute(String key)
Searches for the named attribute in request, session (if valid),
and application scope(s) in order and returns the value associated
or null.
|
javax.servlet.http.HttpServletRequest |
getRequest() |
javax.servlet.http.HttpServletResponse |
getResponse() |
javax.servlet.ServletContext |
getServletContext() |
org.apache.velocity.context.Context |
getVelocityContext() |
org.apache.velocity.app.VelocityEngine |
getVelocityEngine() |
static final String REQUEST
static final String RESPONSE
static final String SESSION
static final String APPLICATION
static final String SERVLET_CONTEXT_KEY
static final String DEFAULT_TOOLBOX_KEY
javax.servlet.http.HttpServletRequest getRequest()
HttpServletRequest
for this request.javax.servlet.http.HttpServletResponse getResponse()
HttpServletResponse
for this request.javax.servlet.ServletContext getServletContext()
ServletContext
for this request.Object getAttribute(String key)
Searches for the named attribute in request, session (if valid), and application scope(s) in order and returns the value associated or null.
key
- attribute keyorg.apache.velocity.context.Context getVelocityContext()
org.apache.velocity.app.VelocityEngine getVelocityEngine()
Copyright © 2002–2021 The Apache Software Foundation. All rights reserved.