org.apache.tiles.request.velocity
Class VelocityRequest

Package class diagram package VelocityRequest
java.lang.Object
  extended by org.apache.tiles.request.AbstractRequest
      extended by org.apache.tiles.request.DispatchRequestWrapper
          extended by org.apache.tiles.request.AbstractViewRequest
              extended by org.apache.tiles.request.velocity.VelocityRequest
All Implemented Interfaces:
DispatchRequest, Request, RequestWrapper

public class VelocityRequest
extends AbstractViewRequest

The implementation of the Tiles request context specific for Velocity.

Version:
$Rev: 1332186 $ $Date: 2012-04-30 09:20:15 -0400 (Mon, 30 Apr 2012) $

Field Summary
 
Fields inherited from class org.apache.tiles.request.AbstractRequest
FORCE_INCLUDE_ATTRIBUTE_NAME
 
Constructor Summary
VelocityRequest(DispatchRequest enclosedRequest, org.apache.velocity.context.Context ctx, Writer writer)
          Constructor.
 
Method Summary
static VelocityRequest createVelocityRequest(ApplicationContext applicationContext, HttpServletRequest request, HttpServletResponse response, org.apache.velocity.context.Context velocityContext, Writer writer)
          Factory method to create a Velocity request.
protected  void doInclude(String path)
          Includes the result.
 List<String> getAvailableScopes()
          Returns all available scopes, that are the ones returned by #getNativeScopes() plus derivative scopes (e.g.
 Map<String,Object> getContext(String scope)
          Returns a context map, given the scope name.
 Map<String,Object> getPageScope()
          Returns the page scope.
 PrintWriter getPrintWriter()
          Returns a print writer to be used to write directly in the response.
 Writer getWriter()
          Returns a writer to be used to write directly in the response.
 
Methods inherited from class org.apache.tiles.request.AbstractViewRequest
dispatch, include
 
Methods inherited from class org.apache.tiles.request.DispatchRequestWrapper
getApplicationContext, getHeader, getHeaderValues, getOutputStream, getParam, getParamValues, getRequestLocale, getResponseHeaders, getWrappedRequest, isResponseCommitted, isUserInRole, setContentType
 
Methods inherited from class org.apache.tiles.request.AbstractRequest
isForceInclude, setForceInclude
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VelocityRequest

public VelocityRequest(DispatchRequest enclosedRequest,
                       org.apache.velocity.context.Context ctx,
                       Writer writer)
Constructor.

Parameters:
enclosedRequest - The request that exposes non-Velocity specific properties
ctx - The Velocity current context.
writer - The writer to use to render the response. It may be null, if not necessary.
Method Detail

createVelocityRequest

public static VelocityRequest createVelocityRequest(ApplicationContext applicationContext,
                                                    HttpServletRequest request,
                                                    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

public List<String> getAvailableScopes()
Description copied from class: DispatchRequestWrapper
Returns all available scopes, that are the ones returned by #getNativeScopes() plus derivative scopes (e.g. flash scope).

Specified by:
getAvailableScopes in interface Request
Overrides:
getAvailableScopes in class DispatchRequestWrapper
Returns:
All the available scopes.

doInclude

protected void doInclude(String path)
                  throws IOException
Includes the result. By default, uses the wrapped request for the inclusion.

Overrides:
doInclude in class AbstractViewRequest
Parameters:
path - The path whose result will be included.
Throws:
IOException - If something goes wrong.

getPrintWriter

public PrintWriter getPrintWriter()
Returns a print writer to be used to write directly in the response.

Specified by:
getPrintWriter in interface Request
Overrides:
getPrintWriter in class DispatchRequestWrapper
Returns:
The print writer that writes in the response.

getWriter

public Writer getWriter()
Returns a writer to be used to write directly in the response.

Specified by:
getWriter in interface Request
Overrides:
getWriter in class DispatchRequestWrapper
Returns:
The writer that writes in the response.

getPageScope

public Map<String,Object> getPageScope()
Returns the page scope.

Returns:
The page scope.

getContext

public Map<String,Object> getContext(String scope)
Description copied from class: DispatchRequestWrapper
Returns a context map, given the scope name.

Specified by:
getContext in interface Request
Overrides:
getContext in class DispatchRequestWrapper
Parameters:
scope - The name of the scope.
Returns:
The context.


Copyright © 2001-2012 Apache Software Foundation. All Rights Reserved.