Class FreemarkerRequest
java.lang.Object
org.apache.tiles.request.AbstractRequest
org.apache.tiles.request.DispatchRequestWrapper
org.apache.tiles.request.AbstractViewRequest
org.apache.tiles.request.freemarker.FreemarkerRequest
- All Implemented Interfaces:
DispatchRequest
,Request
,RequestWrapper
The FreeMarker-specific request context.
-
Field Summary
Fields inherited from class org.apache.tiles.request.AbstractRequest
FORCE_INCLUDE_ATTRIBUTE_NAME
Fields inherited from interface org.apache.tiles.request.Request
APPLICATION_SCOPE, REQUEST_SCOPE
-
Constructor Summary
ConstructorsConstructorDescriptionFreemarkerRequest
(DispatchRequest enclosedRequest, freemarker.core.Environment env) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic FreemarkerRequest
createServletFreemarkerRequest
(ApplicationContext applicationContext, freemarker.core.Environment env) Creates a new Freemarker request.Returns all available scopes.getContext
(String scope) Returns a context map, given the scope name.freemarker.core.Environment
Returns the environment object.Returns the page scope.Returns a print writer to be used to write directly in the response.Return the preferred Locale in which the client will accept content.Returns a writer to be used to write directly in the response.Methods inherited from class org.apache.tiles.request.AbstractViewRequest
dispatch, doInclude, include
Methods inherited from class org.apache.tiles.request.DispatchRequestWrapper
getApplicationContext, getHeader, getHeaderValues, getOutputStream, getParam, getParamValues, getResponseHeaders, getWrappedRequest, isResponseCommitted, isUserInRole, setContentType
Methods inherited from class org.apache.tiles.request.AbstractRequest
isForceInclude, setForceInclude
-
Constructor Details
-
FreemarkerRequest
Constructor.- Parameters:
enclosedRequest
- The request that exposes non-FreeMarker specific propertiesenv
- The FreeMarker environment.
-
-
Method Details
-
createServletFreemarkerRequest
public static FreemarkerRequest createServletFreemarkerRequest(ApplicationContext applicationContext, freemarker.core.Environment env) Creates a new Freemarker request.- Parameters:
applicationContext
- The application context.env
- The Freemarker environment object.- Returns:
- A new request.
-
getEnvironment
public freemarker.core.Environment getEnvironment()Returns the environment object.- Returns:
- The environment.
-
getRequestLocale
Return the preferred Locale in which the client will accept content.- Specified by:
getRequestLocale
in interfaceRequest
- Overrides:
getRequestLocale
in classDispatchRequestWrapper
- Returns:
- The current request locale. It is the locale of the request
object itself, and it is NOT the locale that the user wants to use. See
LocaleResolver
to implement strategies to resolve locales.
-
getPageScope
Returns the page scope.- Returns:
- The page scope.
-
getAvailableScopes
Description copied from class:DispatchRequestWrapper
Returns 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:
getAvailableScopes
in interfaceRequest
- Overrides:
getAvailableScopes
in classDispatchRequestWrapper
- Returns:
- All the available scopes.
-
getPrintWriter
Returns a print writer to be used to write directly in the response.- Specified by:
getPrintWriter
in interfaceRequest
- Overrides:
getPrintWriter
in 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:
getWriter
in interfaceRequest
- Overrides:
getWriter
in classDispatchRequestWrapper
- Returns:
- The writer that writes in the response.
-
getContext
Description copied from class:DispatchRequestWrapper
Returns 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:
getContext
in interfaceRequest
- Overrides:
getContext
in classDispatchRequestWrapper
- Parameters:
scope
- The name of the scope.- Returns:
- The context.
-