|
NextApp Echo App Container 1.1.4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nextapp.echoservlet.Template
A service which produces templated text output. Templates are used in
cases where the server must render a mostly static document that contains
text that may vary. This service is similar to StaticText
,
but offers the ability to have dynamically inserted text at specified
points. A dynamic area is specified by adding a "variable name"
to the template. Variables names are enclosed in dollar signs.
The following example document shows how a Template can be used:
In the year $Year$, annual sales were $$$AnnualSales$.
This sample has two variables, "Year" and "Annual
Sales". The double dollar sign will be rendered as a single dollar
sign. The variable data will be extracted from the renderer's
VariableData
object.
Constructor Summary | |
Template(ContentType contentType,
java.lang.String templateData)
Deprecated. The Template(String, ContentType, String) constructor should be used instead. Use of this version may result in errors if applications are migrated between VMs, due to the Service having a different identifier on each VM. |
|
Template(java.lang.String identifier,
ContentType contentType,
java.lang.String templateData)
Creates a content template from the given String. |
Method Summary | |
static Template |
createFromResource(java.lang.String resourceName)
Deprecated. The createFromResource(String, String) method should be used instead. Use of this version may result in errors if applications are migrated between VMs, due to the Service having a different identifier on each VM. |
static Template |
createFromResource(java.lang.String identifier,
java.lang.String resourceName)
Creates a Template object by way of a resource name. |
ContentType |
getContentType()
Returns the content type. |
Id |
getId()
Returns a unique identifier for this service. |
void |
service(Connection conn)
Services an HTTP request. |
java.lang.String |
toString()
Renders the content template as a String. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Template(ContentType contentType, java.lang.String templateData)
contentType
- The content type of the output.templateData
- A String containing the template data.public Template(java.lang.String identifier, ContentType contentType, java.lang.String templateData)
contentType
- The content type of the output.templateData
- A String containing the template data.identifier
- A unique identifier for this service.Method Detail |
public static Template createFromResource(java.lang.String resourceName)
Template
object by way of a resource name.
The content type will be determined from the resource's extension.
JavaScript resources will be compressed.
resourceName
- The name of the resource from which to create the
StaticText
object.
Template
object containing the content of the
specified resource.public static Template createFromResource(java.lang.String identifier, java.lang.String resourceName)
Template
object by way of a resource name.
The content type will be determined from the resource's extension.
JavaScript resources will be compressed.
identifier
- A unique identifier for this service.resourceName
- The name of the resource from which to create the
StaticText
object.
Template
object containing the content of the
specified resource.public ContentType getContentType()
public Id getId()
Service
getId
in interface Service
Service.getId()
public void service(Connection conn) throws java.io.IOException
Service
service
in interface Service
conn
- A Connection
object which wraps
HttpServletRequest
and
HttpServletResponse
objects and provides
access to the facilities of the Echo application container.
java.io.IOException
- in the event of errors related to processing the
HTTP request or producing a response.Service.service(Connection)
public java.lang.String toString()
|
NextApp Echo App Container 1.1.4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |