org.springframework.web.servlet.view.xslt
Class AbstractXsltView

org.springframework.context.support.ApplicationObjectSupport
  |
  +--org.springframework.web.context.support.WebApplicationObjectSupport
        |
        +--org.springframework.web.servlet.view.AbstractView
              |
              +--org.springframework.web.servlet.view.xslt.AbstractXsltView

public abstract class AbstractXsltView
extends AbstractView

Convenient superclass for views rendered using an XSLT stylesheet. Subclasses must provide the XML W3C document to transform. They do not need to concern themselves with XSLT.

Properties:

Setting cache to false will cause the templates object to be reloaded for each rendering. This is useful during development, but will seriously affect performance in production and isn't threadsafe.

Author:
Rod Johnson
Version: $Id: AbstractXsltView.java,v 1.7 2004/02/07 00:18:32 jhoeller Exp $

Method Summary
 final voidsetCache(boolean cache)
          Activate or deactivate the cache.
 final voidsetRoot(String root)
          Document root element name.
 final voidsetStylesheetLocation(Resource stylesheetLocation)
          Set the location of the XSLT stylesheet.
 final voidsetUriResolver(URIResolver uriResolver)
          Set the URIResolver used in the transform.

Methods inherited from class org.springframework.web.servlet.view.AbstractView
addStaticAttribute, getBeanName, getStaticAttributes, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setRequestContextAttribute

Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, setApplicationContext

Method Detail

setCache

public final void setCache(boolean cache)
Activate or deactivate the cache.
Parameters:
cache - whether to activate the cache

setRoot

public final void setRoot(String root)
Document root element name. Only used if we're not passed a single Node as model.
Parameters:
root - document root element name

setStylesheetLocation

public final void setStylesheetLocation(Resource stylesheetLocation)
Set the location of the XSLT stylesheet.
Parameters:
stylesheetLocation - the location of the XSLT stylesheet
See Also:
org.springframework.context.ApplicationContext.getResource(java.lang.String)

setUriResolver

public final void setUriResolver(URIResolver uriResolver)
Set the URIResolver used in the transform. The URIResolver handles calls to the XSLT document() function. This method can be used by subclasses or as a bean property
Parameters:
uriResolver - URIResolver to set. No URIResolver will be set if this is null (this is the default).

Association Links

to Class org.springframework.core.io.Resource

URL of stylesheet

to Class java.lang.String

Document root element name

to Class javax.xml.transform.URIResolver

Custom URIResolver, set by subclass or as bean property

to Class javax.xml.transform.TransformerFactory

to Class javax.xml.transform.Templates

XSLT Template