Class ThymeleafView
- Object
-
- org.springframework.context.support.ApplicationObjectSupport
-
- org.springframework.web.context.support.WebApplicationObjectSupport
-
- org.thymeleaf.spring5.view.AbstractThymeleafView
-
- org.thymeleaf.spring5.view.ThymeleafView
-
- 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
- Direct Known Subclasses:
AjaxThymeleafView
public class ThymeleafView extends AbstractThymeleafView
Base implementation of the Spring WebMVC
View
interface.Views represent a template being executed, after being resolved (and instantiated) by a
ViewResolver
.This is the default view implementation resolved by
ThymeleafViewResolver
.- 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_PROCESSING
-
-
Constructor Summary
Constructors Constructor Description ThymeleafView()
Creates a new instance ofThymeleafView
.ThymeleafView(String templateName)
Creates a new instance ofThymeleafView
, specifying the template name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getMarkupSelector()
Returns the markup selector defining the part of the template that should be processed.void
render(Map<String,?> model, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
protected void
renderFragment(Set<String> markupSelectorsToRender, Map<String,?> model, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
void
setMarkupSelector(String markupSelector)
Sets the markup selector defining the part of the template that should be processed.-
Methods 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, setTemplateName
-
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
-
-
-
-
Constructor Detail
-
ThymeleafView
public ThymeleafView()
Creates a new instance of
ThymeleafView
.
-
ThymeleafView
public ThymeleafView(String templateName)
Creates a new instance of
ThymeleafView
, specifying the template name.- Parameters:
templateName
- the template name.
-
-
Method Detail
-
getMarkupSelector
public String getMarkupSelector()
Returns the markup selector defining the part of the template that should be processed.
This selector will be used for selecting the section of the template that should be processed, discarding the rest of the template. If null, the whole template will be processed.
Subclasses of
ThymeleafView
might choose not to honor this parameter, disallowing the processing of template fragments.- Returns:
- the markup selector currently set, or null of no fragment has been specified yet.
-
setMarkupSelector
public void setMarkupSelector(String markupSelector)
Sets the markup selector defining the part of the template that should be processed.
This selector will be used for selecting the section of the template that should be processed, discarding the rest of the template. If null, the whole template will be processed.
Subclasses of
ThymeleafView
might choose not to honor this parameter, disallowing the processing of template fragments.- Parameters:
markupSelector
- the markup selector to be set.
-
render
public void render(Map<String,?> model, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception
- Throws:
Exception
-
-