public class AjaxTilesView
extends org.springframework.web.servlet.view.tiles2.TilesView
This implementation uses the SpringJavascriptAjaxHandler
by default to determine whether the current request
is an Ajax request. On an Ajax request, a "fragments" parameter will be extracted from the request in order to
determine which attributes to render from the current tiles view.
Constructor and Description |
---|
AjaxTilesView() |
Modifier and Type | Method and Description |
---|---|
protected void |
addRuntimeAttributes(org.apache.tiles.impl.BasicTilesContainer container,
java.util.Map resultMap,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Iterate over dynamically added Tiles attributes (see "Runtime Composition" in the Tiles documentation) and add
them to the output Map passed as input.
|
void |
afterPropertiesSet() |
protected void |
flattenAttributeMap(org.apache.tiles.impl.BasicTilesContainer container,
org.apache.tiles.context.TilesRequestContext requestContext,
java.util.Map resultMap,
org.apache.tiles.Definition compositeDefinition,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Iterate over all attributes in the given Tiles definition.
|
AjaxHandler |
getAjaxHandler() |
protected java.lang.String[] |
getRenderFragments(java.util.Map model,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
protected void |
renderMergedOutputModel(java.util.Map model,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
void |
setAjaxHandler(AjaxHandler ajaxHandler) |
getUrl, isUrlRequired, setUrl, toString
addStaticAttribute, createMergedOutputModel, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, generatesDownloadContent, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, isExposePathVariables, prepareResponse, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setExposePathVariables, setRequestContextAttribute, setResponseContentType, writeToResponse
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
public void afterPropertiesSet() throws java.lang.Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
afterPropertiesSet
in class org.springframework.web.servlet.view.AbstractUrlBasedView
java.lang.Exception
public AjaxHandler getAjaxHandler()
public void setAjaxHandler(AjaxHandler ajaxHandler)
protected void renderMergedOutputModel(java.util.Map model, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.lang.Exception
renderMergedOutputModel
in class org.springframework.web.servlet.view.tiles2.TilesView
java.lang.Exception
protected java.lang.String[] getRenderFragments(java.util.Map model, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
protected void flattenAttributeMap(org.apache.tiles.impl.BasicTilesContainer container, org.apache.tiles.context.TilesRequestContext requestContext, java.util.Map resultMap, org.apache.tiles.Definition compositeDefinition, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Iterate over all attributes in the given Tiles definition. Every attribute value that represents a template (i.e. start with "/") or is a nested definition is added to a Map. The method class itself recursively to traverse nested definitions.
container
- the TilesContainerrequestContext
- the TilesRequestContextresultMap
- the output Map where attributes of interest are added to.compositeDefinition
- the definition to search for attributes of interest.request
- the servlet requestresponse
- the servlet responseprotected void addRuntimeAttributes(org.apache.tiles.impl.BasicTilesContainer container, java.util.Map resultMap, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Iterate over dynamically added Tiles attributes (see "Runtime Composition" in the Tiles documentation) and add them to the output Map passed as input.
container
- the Tiles containerresultMap
- the output Map where attributes of interest are added to.request
- the Servlet requestresponse
- the Servlet response