Class VelocityRequest
java.lang.Object
org.apache.tiles.request.AbstractRequest
org.apache.tiles.request.DispatchRequestWrapper
org.apache.tiles.request.AbstractViewRequest
org.apache.tiles.request.velocity.VelocityRequest
- All Implemented Interfaces:
DispatchRequest,Request,RequestWrapper
The implementation of the Tiles request context specific for Velocity.
-
Field Summary
Fields inherited from class org.apache.tiles.request.AbstractRequest
FORCE_INCLUDE_ATTRIBUTE_NAMEFields inherited from interface org.apache.tiles.request.Request
APPLICATION_SCOPE, REQUEST_SCOPE -
Constructor Summary
ConstructorsConstructorDescriptionVelocityRequest(DispatchRequest enclosedRequest, org.apache.velocity.context.Context ctx, Writer writer) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic VelocityRequestcreateVelocityRequest(ApplicationContext applicationContext, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.apache.velocity.context.Context velocityContext, Writer writer) Factory method to create a Velocity request.protected voidIncludes the result.Returns all available scopes.getContext(String scope) Returns a context map, given the scope name.Returns the page scope.Returns a print writer to be used to write directly in the response.Returns a writer to be used to write directly in the response.Methods inherited from class org.apache.tiles.request.AbstractViewRequest
dispatch, includeMethods inherited from class org.apache.tiles.request.DispatchRequestWrapper
getApplicationContext, getHeader, getHeaderValues, getOutputStream, getParam, getParamValues, getRequestLocale, getResponseHeaders, getWrappedRequest, isResponseCommitted, isUserInRole, setContentTypeMethods inherited from class org.apache.tiles.request.AbstractRequest
isForceInclude, setForceInclude
-
Constructor Details
-
VelocityRequest
public VelocityRequest(DispatchRequest enclosedRequest, org.apache.velocity.context.Context ctx, Writer writer) Constructor.- Parameters:
enclosedRequest- The request that exposes non-Velocity specific propertiesctx- The Velocity current context.writer- The writer to use to render the response. It may be null, if not necessary.
-
-
Method Details
-
createVelocityRequest
public static VelocityRequest createVelocityRequest(ApplicationContext applicationContext, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.apache.velocity.context.Context velocityContext, Writer writer) Factory method to create a Velocity request.- Parameters:
applicationContext- The application context.request- The request.response- The response.velocityContext- The Velocity context.writer- The writer to write into.- Returns:
- The request.
-
getAvailableScopes
Description copied from class:DispatchRequestWrapperReturns all available scopes. The scopes are ordered according to their lifetime, the innermost, shorter lived scope appears first, and the outermost, longer lived scope appears last. Besides, the scopes "request" and "application" always included in the list.- Specified by:
getAvailableScopesin interfaceRequest- Overrides:
getAvailableScopesin classDispatchRequestWrapper- Returns:
- All the available scopes.
-
doInclude
Includes the result. By default, uses the wrapped request for the inclusion.- Overrides:
doIncludein classAbstractViewRequest- Parameters:
path- The path whose result will be included.- Throws:
IOException- If something goes wrong.
-
getPrintWriter
Returns a print writer to be used to write directly in the response.- Specified by:
getPrintWriterin interfaceRequest- Overrides:
getPrintWriterin classDispatchRequestWrapper- Returns:
- The print writer that writes in the response.
-
getWriter
Returns a writer to be used to write directly in the response.- Specified by:
getWriterin interfaceRequest- Overrides:
getWriterin classDispatchRequestWrapper- Returns:
- The writer that writes in the response.
-
getPageScope
Returns the page scope.- Returns:
- The page scope.
-
getContext
Description copied from class:DispatchRequestWrapperReturns a context map, given the scope name. This method always return a map for all the scope names returned by getAvailableScopes(). That map may be writable, or immutable, depending on the implementation.- Specified by:
getContextin interfaceRequest- Overrides:
getContextin classDispatchRequestWrapper- Parameters:
scope- The name of the scope.- Returns:
- The context.
-