Class AjaxThymeleafView
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.context.ApplicationContextAware,org.springframework.web.context.ServletContextAware,org.springframework.web.servlet.View,AjaxEnabledView
- Direct Known Subclasses:
FlowAjaxThymeleafView
Subclass of ThymeleafView adding compatibility with AJAX events in
Spring JavaScript (part of Spring WebFlow). This allows this View implementation
to be able to return only fragments of the page.
These rendering of fragments is used, for example, in Spring WebFlow's <render> instructions (though not only).
This view searches for a comma-separated list of markup selectors in a request
parameter called fragments.
- Since:
- 3.0.3
- Author:
- Daniel Fernández
-
Field Summary
Fields inherited from class org.thymeleaf.spring5.view.AbstractThymeleafView
DEFAULT_CONTENT_TYPE, DEFAULT_PRODUCE_PARTIAL_OUTPUT_WHILE_PROCESSINGFields inherited from class org.springframework.context.support.ApplicationObjectSupport
loggerFields inherited from interface org.springframework.web.servlet.View
PATH_VARIABLES, RESPONSE_STATUS_ATTRIBUTE, SELECTED_CONTENT_TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.webflow.context.servlet.AjaxHandlerReturn the AJAX handler (from Spring Javascript) used to determine whether a request is an AJAX request or not.getRenderFragments(Map model, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) voidrender(Map<String, ?> model, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) voidsetAjaxHandler(org.springframework.webflow.context.servlet.AjaxHandler ajaxHandler) Sets the AJAX handler (from Spring Javascript) used to determine whether a request is an AJAX request or not.Methods inherited from class org.thymeleaf.spring5.view.ThymeleafView
getMarkupSelector, renderFragment, setMarkupSelectorMethods inherited from class org.thymeleaf.spring5.view.AbstractThymeleafView
addRequestContextAsVariable, addStaticVariable, getBeanName, getCharacterEncoding, getContentType, getForceContentType, getLocale, getProducePartialOutputWhileProcessing, getStaticVariables, getTemplateEngine, getTemplateName, isContentTypeSet, isForceContentTypeSet, isProducePartialOutputWhileProcessingSet, setBeanName, setCharacterEncoding, setContentType, setForceContentType, setLocale, setProducePartialOutputWhileProcessing, setStaticVariables, setTemplateEngine, setTemplateNameMethods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContextMethods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, obtainApplicationContext, requiredContextClass, setApplicationContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.web.servlet.View
getContentType
-
Constructor Details
-
AjaxThymeleafView
public AjaxThymeleafView()
-
-
Method Details
-
getAjaxHandler
public org.springframework.webflow.context.servlet.AjaxHandler getAjaxHandler()Description copied from interface:AjaxEnabledViewReturn the AJAX handler (from Spring Javascript) used to determine whether a request is an AJAX request or not.
Views implementing this interface should be used with an instance of
AjaxThymeleafViewResolveror any of its subclasses, so thatAjaxEnabledView.setAjaxHandler(AjaxHandler)can be called by the resolver when resolving the view, setting the default AJAX handler being used.- Specified by:
getAjaxHandlerin interfaceAjaxEnabledView- Returns:
- the AJAX handler.
-
setAjaxHandler
public void setAjaxHandler(org.springframework.webflow.context.servlet.AjaxHandler ajaxHandler) Description copied from interface:AjaxEnabledViewSets the AJAX handler (from Spring Javascript) used to determine whether a request is an AJAX request or not.
Views implementing this interface should be used with an instance of
AjaxThymeleafViewResolveror any of its subclasses, so that this method can be called by the resolver when resolving the view, setting the default AJAX handler being used.- Specified by:
setAjaxHandlerin interfaceAjaxEnabledView- Parameters:
ajaxHandler- the AJAX handler.
-
render
public void render(Map<String, ?> model, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception- Specified by:
renderin interfaceorg.springframework.web.servlet.View- Overrides:
renderin classThymeleafView- Throws:
Exception
-
getRenderFragments
-