public class TilesView extends AbstractUrlBasedView
View implementation that renders
through the Tiles Request API. The "url" property is interpreted as name of a
Tiles definition.DEFAULT_CONTENT_TYPEPATH_VARIABLES, RESPONSE_STATUS_ATTRIBUTE, SELECTED_CONTENT_TYPE| Constructor and Description |
|---|
TilesView() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
boolean |
checkResource(Locale locale)
Check whether the underlying resource that the configured URL points to
actually exists.
|
protected Request |
createTilesRequest(HttpServletRequest request,
HttpServletResponse response)
Create a Tiles
Request. |
protected void |
renderMergedOutputModel(Map<String,Object> model,
HttpServletRequest request,
HttpServletResponse response)
Subclasses must implement this method to actually render the view.
|
protected void |
setExposeJstlAttributes(boolean exposeJstlAttributes)
Whether to expose JSTL attributes.
|
void |
setRenderer(Renderer renderer)
Set the
Renderer to use. |
getUrl, isUrlRequired, setUrl, toStringaddStaticAttribute, createMergedOutputModel, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, generatesDownloadContent, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, isExposePathVariables, prepareResponse, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setExposePathVariables, setRequestContextAttribute, setResponseContentType, writeToResponsegetServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContextpublic void setRenderer(Renderer renderer)
Renderer to use.
If not set, by default DefinitionRenderer is used.protected void setExposeJstlAttributes(boolean exposeJstlAttributes)
true.public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanafterPropertiesSet in class AbstractUrlBasedViewExceptionpublic boolean checkResource(Locale locale) throws Exception
AbstractUrlBasedViewcheckResource in class AbstractUrlBasedViewlocale - the desired Locale that we're looking fortrue if the resource exists (or is assumed to exist);
false if we know that it does not existException - if the resource exists but is invalid (e.g. could not be parsed)protected void renderMergedOutputModel(Map<String,Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception
AbstractViewThe first step will be preparing the request: In the JSP case, this would mean setting model objects as request attributes. The second step will be the actual rendering of the view, for example including the JSP via a RequestDispatcher.
renderMergedOutputModel in class AbstractViewmodel - combined output Map (never null),
with dynamic values taking precedence over static attributesrequest - current HTTP requestresponse - current HTTP responseException - if rendering failedprotected Request createTilesRequest(HttpServletRequest request, HttpServletResponse response)
Request.
This implementation creates a ServletRequest.
request - the current requestresponse - the current response