public class ThymeleafView extends AbstractThymeleafView
Base implementation of the Spring MVC 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
.
DEFAULT_CONTENT_TYPE
Modifier | Constructor and Description |
---|---|
protected |
ThymeleafView()
Creates a new instance of ThymeleafView.
|
protected |
ThymeleafView(String templateName)
Creates a new instance of ThymeleafView, specifying the
template name.
|
Modifier and Type | Method and Description |
---|---|
org.thymeleaf.fragment.IFragmentSpec |
getFragmentSpec()
Returns the fragment specification (
IFragmentSpec ) 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(org.thymeleaf.fragment.IFragmentSpec fragmentSpecToRender,
Map<String,?> model,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
void |
setFragmentSpec(org.thymeleaf.fragment.IFragmentSpec fragmentSpec)
Sets the fragment specification (
IFragmentSpec ) defining the part
of the template that should be processed. |
addRequestContextAsVariable, addStaticVariable, getBeanName, getCharacterEncoding, getContentType, getLocale, getStaticVariables, getTemplateEngine, getTemplateName, isContentTypeSet, setBeanName, setCharacterEncoding, setContentType, setLocale, setStaticVariables, setTemplateEngine, setTemplateName
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
protected ThymeleafView()
Creates a new instance of ThymeleafView.
protected ThymeleafView(String templateName)
Creates a new instance of ThymeleafView, specifying the template name.
templateName
- the template name.public org.thymeleaf.fragment.IFragmentSpec getFragmentSpec()
Returns the fragment specification (IFragmentSpec
) defining the part
of the template that should be processed.
This fragment spec 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.
public void setFragmentSpec(org.thymeleaf.fragment.IFragmentSpec fragmentSpec)
Sets the fragment specification (IFragmentSpec
) defining the part
of the template that should be processed.
This fragment spec 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.
fragmentSpec
- the fragment specification to be set.public void render(Map<String,?> model, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception
Exception
Copyright © 2016 The THYMELEAF team. All rights reserved.