com.opensymphony.webwork.views.xslt
Class XSLTResult

java.lang.Object
  extended by com.opensymphony.webwork.views.xslt.XSLTResult
All Implemented Interfaces:
Result, Serializable

public class XSLTResult
extends Object
implements Result

XSLTResult provides support for XSLT generated views of WebWork actions. XSLTResult dynamically creates a DOM representation of the invoking WebWork action object and applies a specified stylesheet to it. The DOM representation of the WebWork action is produced by JavaBeans style introspection of the properties of the action using an extensible AdapterFactory. Common Java types and collection are supported as well as arbitrary beans composed of these types. (See AdapterFactory). Action properties may also return their own DOMs (Object implementing Node, Document, or other DOM types) which will then appear directly as part of the the result DOM for the stylesheet. The contents of the result tag normally specify the location of an XSL stylesheet, relative to the servlet context. e.g.: ... /foo.xsl If the stylesheet location is absent, the raw XML is returned. By default, stylesheets are cached for performance. This can be disabled by setting the webwork property webwork.xslt.nocache to true. XSLTResult utilizes a servlet context sensitive URIResolve

Author:
Philipp Meier, Pat Niemeyer (pat@pat.net
See Also:
AdapterFactory, Serialized Form

Field Summary
static String DEFAULT_PARAM
           
protected  boolean noCache
           
 
Constructor Summary
XSLTResult()
           
 
Method Summary
 void execute(ActionInvocation invocation)
          Represents a generic interface for all action execution results, whether that be displaying a webpage, generating an email, sending a JMS message, etc.
protected  AdapterFactory getAdapterFactory()
           
protected  Source getDOMSourceForStack(Object action)
           
 String getStylesheetLocation()
           
protected  Templates getTemplates(String path)
           
protected  URIResolver getURIResolver()
          Get the URI Resolver to be called by the processor when it encounters an xsl:include, xsl:import, or document() function.
protected  void setAdapterFactory(AdapterFactory adapterFactory)
           
 void setLocation(String location)
          Deprecated. Use #setStylesheetLocation(String)
 void setParse(boolean parse)
          If true, parse the stylesheet location for OGNL expressions.
 void setStylesheetLocation(String location)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PARAM

public static final String DEFAULT_PARAM
See Also:
Constant Field Values

noCache

protected boolean noCache
Constructor Detail

XSLTResult

public XSLTResult()
Method Detail

setLocation

public void setLocation(String location)
Deprecated. Use #setStylesheetLocation(String)


setStylesheetLocation

public void setStylesheetLocation(String location)

getStylesheetLocation

public String getStylesheetLocation()

setParse

public void setParse(boolean parse)
If true, parse the stylesheet location for OGNL expressions.

Parameters:
parse -

execute

public void execute(ActionInvocation invocation)
             throws Exception
Description copied from interface: Result
Represents a generic interface for all action execution results, whether that be displaying a webpage, generating an email, sending a JMS message, etc.

Specified by:
execute in interface Result
Throws:
Exception

getAdapterFactory

protected AdapterFactory getAdapterFactory()

setAdapterFactory

protected void setAdapterFactory(AdapterFactory adapterFactory)

getURIResolver

protected URIResolver getURIResolver()
Get the URI Resolver to be called by the processor when it encounters an xsl:include, xsl:import, or document() function. The default is an instance of ServletURIResolver, which operates relative to the servlet context.


getTemplates

protected Templates getTemplates(String path)
                          throws TransformerException,
                                 IOException
Throws:
TransformerException
IOException

getDOMSourceForStack

protected Source getDOMSourceForStack(Object action)
                               throws IllegalAccessException,
                                      InstantiationException
Throws:
IllegalAccessException
InstantiationException

WebWork Project Page