EchoPoint API - 3.0.0b5
App Webcontainer

echopoint.template
Class JspTemplateDataSource

java.lang.Object
  extended by echopoint.template.AbstractTemplateDataSource
      extended by echopoint.template.JspTemplateDataSource
All Implemented Interfaces:
TemplateDataSource, Serializable

public class JspTemplateDataSource
extends AbstractTemplateDataSource

JspTemplateDataSource takes it template data from a JSP include path.

By default there is no caching of JSP template dtaa. This is because the JSP engines are excellent at deciding when JSP content needs recompiling.

Also since a Java class is compiled out of JSP content, then the speed at which they operate menas caching may not have a dramatic effect.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class echopoint.template.AbstractTemplateDataSource
DEFAULT_CONTENT_TYPE, DEFAULT_ENCODING
 
Constructor Summary
JspTemplateDataSource()
          Creates a JspTemplateDataSource with no JSP path.
JspTemplateDataSource(String jspPath)
          Creates a JspTemplateDataSource that takes its template data from a JSP path
 
Method Summary
 Object getAttribute(String name)
          Returns the value of the named attribute as an Object, or null if no attribute of the given name exists.
 String[] getAttributeNames()
          Returns an array of String containing the names of the attributes available to this JSP request.
 String getCanonicalName()
          Returns a canonical name of this TemplateDataSource.
 InputStream getInputStream()
          This always returns null because the InputStream of JSP data can only be obtained by the backend rendering engine.
 String getJspPath()
           
 void removeAttribute(String name)
          Removes an attribute.
 void setAttribute(String name, Object javaBean)
          Associates a Java bean with a specified name.
 void setJspPath(String jspPath)
          Sets the JSP path to use for template data.
 
Methods inherited from class echopoint.template.AbstractTemplateDataSource
getCachingHints, getCharacterEncoding, getCompilerHints, getContentType, setCachingHints, setCharacterEncoding, setCompilerHints, setContentType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JspTemplateDataSource

public JspTemplateDataSource()
Creates a JspTemplateDataSource with no JSP path.


JspTemplateDataSource

public JspTemplateDataSource(String jspPath)
Creates a JspTemplateDataSource that takes its template data from a JSP path

Method Detail

getJspPath

public String getJspPath()
Returns:
Returns the JSP Path in use.

setJspPath

public void setJspPath(String jspPath)
Sets the JSP path to use for template data.

Parameters:
jspPath - - The newValue to set.

getCanonicalName

public String getCanonicalName()
Description copied from interface: TemplateDataSource
Returns a canonical name of this TemplateDataSource.

The name returned here is used to look up the parsing result of the internal caching, so it should differ for all different TemplateDataSource objects :-)

May return null if this TemplateDataSource is supposed to be parsed each time. The canonical name would be something like a filename or an URL.

Returns:
a unique name of the TemplateDataSource
See Also:
TemplateDataSource.getCanonicalName()

getInputStream

public InputStream getInputStream()
                           throws IOException
This always returns null because the InputStream of JSP data can only be obtained by the backend rendering engine. It does this by exuting the JSP path and capturing the output data.

Returns:
a InputStream containing the template data
Throws:
IOException
See Also:
TemplateDataSource.getInputStream()

getAttribute

public Object getAttribute(String name)
Returns the value of the named attribute as an Object, or null if no attribute of the given name exists.

Attribute names should follow the same conventions as package names. Names beginning with java.*, javax.*, and com.sun.*, are reserved for use by Sun Microsystems.

Parameters:
name - a String specifying the name of the attribute
Returns:
an Object containing the value of the attribute, or null if the attribute does not exist

getAttributeNames

public String[] getAttributeNames()
Returns an array of String containing the names of the attributes available to this JSP request. This method returns an zero length array if there are no attributes available to it.

Returns:
an array of String containing the names of the attributes

setAttribute

public void setAttribute(String name,
                         Object javaBean)
Associates a Java bean with a specified name. This will be inserted into the ServletRequest (with Request scope) before the JSP is called

Bean names should follow the same conventions as package names. Names beginning with java.*, javax.*, and com.sun.*, are reserved for use by Sun Microsystems.

If the value passed in is null, the effect is the same as calling removeAttribute(java.lang.String).

Parameters:
name - - the name to associated with the java Bean. This will become a Request scope attribute within the JSP.
javaBean - - the object to be associated with the name

removeAttribute

public void removeAttribute(String name)
Removes an attribute.

Attribute names should follow the same conventions as package names. Names beginning with java.*, javax.*, and com.sun.*, are reserved for use by Sun Microsystems.

Parameters:
name - - the name associated with the attribute value.

EchoPoint API - 3.0.0b5
App Webcontainer