Interface ViewContext
- All Known Implementing Classes:
ViewToolContext
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.
- Version:
- $Id$
- Author:
- Gabe Sidler, Geir Magnusson Jr., Nathan Bubna
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringKey used for the servlet context object in templates.static final StringDefault key used to store toolboxes in request/session/application attributes.static final StringKey used for the HTTP request object.static final StringKey used for the HTTP response object.static final StringKey used for the servlet context object in tool properties.static final StringKey used for the HTTP session object. -
Method Summary
Modifier and TypeMethodDescriptiongetAttribute(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.HttpServletRequestjavax.servlet.http.HttpServletResponsejavax.servlet.ServletContextorg.apache.velocity.context.Contextorg.apache.velocity.app.VelocityEngine
-
Field Details
-
REQUEST
-
RESPONSE
-
SESSION
-
APPLICATION
-
SERVLET_CONTEXT_KEY
Key used for the servlet context object in tool properties.- See Also:
-
DEFAULT_TOOLBOX_KEY
Default key used to store toolboxes in request/session/application attributes.
-
-
Method Details
-
getRequest
javax.servlet.http.HttpServletRequest getRequest()- Returns:
- the instance of
HttpServletRequestfor this request.
-
getResponse
javax.servlet.http.HttpServletResponse getResponse()- Returns:
- the instance of
HttpServletResponsefor this request.
-
getServletContext
javax.servlet.ServletContext getServletContext()- Returns:
- the instance of
ServletContextfor this request.
-
getAttribute
-
getVelocityContext
org.apache.velocity.context.Context getVelocityContext()- Returns:
- a reference to the current Velocity context.
-
getVelocityEngine
org.apache.velocity.app.VelocityEngine getVelocityEngine()- Returns:
- the current VelocityEngine instance.
-