org.springframework.js.ajax.tiles3
Class AjaxTilesView
java.lang.Object
org.springframework.context.support.ApplicationObjectSupport
org.springframework.web.context.support.WebApplicationObjectSupport
org.springframework.web.servlet.view.AbstractView
org.springframework.web.servlet.view.AbstractUrlBasedView
org.springframework.web.servlet.view.tiles3.TilesView
org.springframework.js.ajax.tiles3.AjaxTilesView
- All Implemented Interfaces:
- org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, org.springframework.web.context.ServletContextAware, org.springframework.web.servlet.View
- Direct Known Subclasses:
- FlowAjaxTiles3View
public class AjaxTilesView
- extends org.springframework.web.servlet.view.tiles3.TilesView
Tiles 3 view implementation that is able to handle partial rendering for Spring
Javascript Ajax requests.
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.
- Since:
- 2.4
- Author:
- Rossen Stoyanchev
Fields inherited from class org.springframework.web.servlet.view.AbstractView |
DEFAULT_CONTENT_TYPE |
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport |
logger |
Fields inherited from interface org.springframework.web.servlet.View |
PATH_VARIABLES, RESPONSE_STATUS_ATTRIBUTE, SELECTED_CONTENT_TYPE |
Method Summary |
protected void |
addRuntimeAttributes(org.apache.tiles.impl.BasicTilesContainer container,
org.apache.tiles.request.Request tilesRequest,
java.util.Map<java.lang.String,org.apache.tiles.Attribute> resultMap)
Iterate over dynamically added Tiles attributes (see "Runtime Composition"
in the Tiles documentation) and add them to the output Map passed as input. |
protected void |
flattenAttributeMap(org.apache.tiles.impl.BasicTilesContainer container,
org.apache.tiles.request.Request tilesRequest,
java.util.Map<java.lang.String,org.apache.tiles.Attribute> resultMap,
org.apache.tiles.Definition definition)
Iterate over all attributes in the given Tiles definition. |
AjaxHandler |
getAjaxHandler()
|
protected java.lang.String[] |
getRenderFragments(java.util.Map<java.lang.String,java.lang.Object> model,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
|
protected void |
renderMergedOutputModel(java.util.Map<java.lang.String,java.lang.Object> model,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
|
void |
setAjaxHandler(AjaxHandler ajaxHandler)
|
Methods inherited from class org.springframework.web.servlet.view.tiles3.TilesView |
afterPropertiesSet, checkResource, createTilesRequest, setExposeJstlAttributes, setRenderer |
Methods inherited from class org.springframework.web.servlet.view.AbstractUrlBasedView |
getUrl, isUrlRequired, setUrl, toString |
Methods inherited from class org.springframework.web.servlet.view.AbstractView |
addStaticAttribute, createMergedOutputModel, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, generatesDownloadContent, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, isExposePathVariables, prepareResponse, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setExposePathVariables, setRequestContextAttribute, setResponseContentType, writeToResponse |
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport |
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext |
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport |
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
AjaxTilesView
public AjaxTilesView()
getAjaxHandler
public AjaxHandler getAjaxHandler()
setAjaxHandler
public void setAjaxHandler(AjaxHandler ajaxHandler)
renderMergedOutputModel
protected void renderMergedOutputModel(java.util.Map<java.lang.String,java.lang.Object> model,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws java.lang.Exception
- Overrides:
renderMergedOutputModel
in class org.springframework.web.servlet.view.tiles3.TilesView
- Throws:
java.lang.Exception
getRenderFragments
protected java.lang.String[] getRenderFragments(java.util.Map<java.lang.String,java.lang.Object> model,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
flattenAttributeMap
protected void flattenAttributeMap(org.apache.tiles.impl.BasicTilesContainer container,
org.apache.tiles.request.Request tilesRequest,
java.util.Map<java.lang.String,org.apache.tiles.Attribute> resultMap,
org.apache.tiles.Definition definition)
- 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.
- Parameters:
container
- the TilesContainertilesRequest
- the Tiles RequestresultMap
- the output Map where attributes of interest are added to.definition
- the definition to search for attributes of interest.
addRuntimeAttributes
protected void addRuntimeAttributes(org.apache.tiles.impl.BasicTilesContainer container,
org.apache.tiles.request.Request tilesRequest,
java.util.Map<java.lang.String,org.apache.tiles.Attribute> resultMap)
- Iterate over dynamically added Tiles attributes (see "Runtime Composition"
in the Tiles documentation) and add them to the output Map passed as input.
- Parameters:
container
- the Tiles containertilesRequest
- the Tiles requestresultMap
- the output Map where attributes of interest are added to.