| org.springframework.web.servlet.view.AbstractUrlBasedView org.springframework.web.servlet.view.xslt.XsltView
XsltView | public class XsltView extends AbstractUrlBasedView (Code) | | XSLT-driven View that allows for response context to be rendered as the
result of an XSLT transformation.
The XSLT Source object is supplied as a parameter in the model and then
XsltView.locateSource detected during response rendering. Users can either specify
a specific entry in the model via the
XsltView.setSourceKey sourceKey property or
have Spring locate the Source object. This class also provides basic conversion
of objects into Source implementations. See
XsltView.getSourceTypes() here for more details.
All model parameters are passed to the XSLT Transformer as parameters.
In addition the user can configure
XsltView.setOutputProperties output properties to be passed to the Transformer.
author: Rob Harrop author: Juergen Hoeller since: 2.0 |
Method Summary | |
final protected void | configureIndentation(Transformer transformer) Configure the indentation settings for the supplied
Transformer . | protected void | configureResponse(Map model, HttpServletResponse response, Transformer transformer) Configure the supplied
HttpServletResponse . | protected void | configureTransformer(Map model, HttpServletResponse response, Transformer transformer) Configure the supplied
Transformer instance. | protected Source | convertSource(Object source) Convert the supplied
Object into an XSLT
Source if the
Object type is
XsltView.getSourceTypes() supported . | final protected void | copyModelParameters(Map model, Transformer transformer) Copy all entries from the supplied Map into the
Transformer.setParameter(StringObject) parameter set of the supplied
Transformer . | final protected void | copyOutputProperties(Transformer transformer) Copy the configured output
Properties , if any, into the
Transformer.setOutputProperty output property set of the supplied
Transformer . | protected Result | createResult(HttpServletResponse response) Create the XSLT
Result used to render the result of the transformation. | protected Transformer | createTransformer(Templates templates) Create the
Transformer instance used to prefer the XSLT transformation. | protected Class[] | getSourceTypes() Return the array of
Class Classes that are supported when converting to an
XSLT
Source . | protected Source | getStylesheetSource() Get the XSLT
Source for the XSLT template under the
XsltView.setUrl configured URL . | final protected TransformerFactory | getTransformerFactory() Return the TransformerFactory that this XsltView uses. | protected void | initApplicationContext() Initialize this XsltView's TransformerFactory. | protected Source | locateSource(Map model) Locate the
Source object in the supplied model,
converting objects as required. | protected void | renderMergedOutputModel(Map model, HttpServletRequest request, HttpServletResponse response) | public void | setCacheTemplates(boolean cacheTemplates) Turn on/off the caching of the XSLT
Templates instance.
The default value is "true". | public void | setErrorListener(ErrorListener errorListener) Set an implementation of the
javax.xml.transform.ErrorListener interface for custom handling of transformation errors and warnings. | public void | setIndent(boolean indent) Set whether the XSLT transformer may add additional whitespace when
outputting the result tree. | public void | setOutputProperties(Properties outputProperties) Set arbitrary transformer output properties to be applied to the stylesheet. | public void | setSourceKey(String sourceKey) Set the name of the model attribute that represents the XSLT Source. | public void | setUriResolver(URIResolver uriResolver) Set the URIResolver used in the transform. |
getTransformerFactory | final protected TransformerFactory getTransformerFactory()(Code) | | Return the TransformerFactory that this XsltView uses.
the TransformerFactory (never null ) |
initApplicationContext | protected void initApplicationContext() throws BeansException(Code) | | Initialize this XsltView's TransformerFactory.
|
setCacheTemplates | public void setCacheTemplates(boolean cacheTemplates)(Code) | | Turn on/off the caching of the XSLT
Templates instance.
The default value is "true". Only set this to "false" in development,
where caching does not seriously impact performance.
|
setIndent | public void setIndent(boolean indent)(Code) | | Set whether the XSLT transformer may add additional whitespace when
outputting the result tree.
Default is true (on); set this to false (off)
to not specify an "indent" key, leaving the choice up to the stylesheet.
See Also: javax.xml.transform.OutputKeys.INDENT |
setUriResolver | public void setUriResolver(URIResolver uriResolver)(Code) | | Set the URIResolver used in the transform.
The URIResolver handles calls to the XSLT document() function.
|
|
|