org.thymeleaf.spring3.view
Class ThymeleafView

Object
  extended by org.springframework.context.support.ApplicationObjectSupport
      extended by org.springframework.web.context.support.WebApplicationObjectSupport
          extended by org.thymeleaf.spring3.view.AbstractThymeleafView
              extended by org.thymeleaf.spring3.view.ThymeleafView
All Implemented Interfaces:
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 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.

Since:
1.0
Author:
Daniel Fernández

Field Summary
 
Fields inherited from class org.thymeleaf.spring3.view.AbstractThymeleafView
DEFAULT_CONTENT_TYPE
 
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
 
Fields inherited from interface org.springframework.web.servlet.View
RESPONSE_STATUS_ATTRIBUTE
 
Constructor Summary
protected ThymeleafView()
           Creates a new instance of ThymeleafView.
protected ThymeleafView(String templateName)
           Creates a new instance of ThymeleafView, specifying the template name.
 
Method Summary
 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.
 
Methods inherited from class org.thymeleaf.spring3.view.AbstractThymeleafView
addRequestContextAsVariable, addStaticVariable, getBeanName, getCharacterEncoding, getContentType, getLocale, getStaticVariables, getTemplateEngine, getTemplateName, isContentTypeSet, setBeanName, setCharacterEncoding, setContentType, setLocale, setStaticVariables, setTemplateEngine, setTemplateName
 
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 Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThymeleafView

protected ThymeleafView()

Creates a new instance of ThymeleafView.


ThymeleafView

protected ThymeleafView(String templateName)

Creates a new instance of ThymeleafView, specifying the template name.

Parameters:
templateName - the template name.
Method Detail

getFragmentSpec

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.

Returns:
the fragment spec currently set, or null of no fragment has been specified yet.
Since:
2.0.11

setFragmentSpec

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.

Parameters:
fragmentSpec - the fragment specification to be set.
Since:
2.0.11

render

public void render(Map<String,?> model,
                   javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response)
            throws Exception
Throws:
Exception

renderFragment

protected void renderFragment(org.thymeleaf.fragment.IFragmentSpec fragmentSpecToRender,
                              Map<String,?> model,
                              javax.servlet.http.HttpServletRequest request,
                              javax.servlet.http.HttpServletResponse response)
                       throws Exception
Throws:
Exception


Copyright © 2012 The THYMELEAF team. All Rights Reserved.