org.apache.turbine.services.jsp
Class TurbineJspService
java.lang.Object
|
+--org.apache.turbine.services.BaseInitable
|
+--org.apache.turbine.services.BaseService
|
+--org.apache.turbine.services.TurbineBaseService
|
+--org.apache.turbine.services.template.BaseTemplateEngineService
|
+--org.apache.turbine.services.jsp.TurbineJspService
- All Implemented Interfaces:
- Initable, JspService, Service, TemplateEngineService
- public class TurbineJspService
- extends BaseTemplateEngineService
- implements JspService
This is a Service that can process JSP templates from within a Turbine
screen.
- Author:
- John D. McNally, Jason van Zyl, Daniel Rall
Method Summary |
void |
addDefaultObjects(RunData data)
Adds some convenience objects to the request. |
int |
getDefaultBufferSize()
The buffer size |
java.lang.String |
getRelativeTemplateName(java.lang.String template)
Searchs for a template in the default.template path[s] and
returns the template name with a relative path which is
required by
javax.servlet.RequestDispatcher |
void |
handleRequest(RunData data,
java.lang.String filename)
Process the request |
void |
handleRequest(RunData data,
java.lang.String filename,
boolean isForward)
Process the request |
void |
init()
Load all configured components and initialize them. |
void |
init(javax.servlet.ServletConfig config)
Performs early initialization of this Turbine service. |
boolean |
templateExists(java.lang.String template)
Determine whether a given template exists. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TurbineJspService
public TurbineJspService()
init
public void init()
throws InitializationException
- Load all configured components and initialize them. This is
a zero parameter variant which queries the Turbine Servlet
for its config.
- Specified by:
init
in interface Initable
- Overrides:
init
in class TurbineBaseService
- Throws:
InitializationException
- Something went wrong in the init
stage
init
public void init(javax.servlet.ServletConfig config)
throws InitializationException
- Performs early initialization of this Turbine service.
- Overrides:
init
in class TurbineBaseService
- Parameters:
config
- The ServletConfiguration from Turbine- Throws:
InitializationException
- Something went wrong when starting up.
addDefaultObjects
public void addDefaultObjects(RunData data)
- Adds some convenience objects to the request. For example an instance
of JspLink which can be used to generate links to other templates.
- Specified by:
addDefaultObjects
in interface JspService
- Parameters:
RunData
- the turbine rundata object
getDefaultBufferSize
public int getDefaultBufferSize()
- The buffer size
- Specified by:
getDefaultBufferSize
in interface JspService
handleRequest
public void handleRequest(RunData data,
java.lang.String filename)
throws TurbineException
- Process the request
- Specified by:
handleRequest
in interface JspService
- Parameters:
RunData
- String
- the filename of the template.- Throws:
TurbineException
- Any exception trown while processing will be
wrapped into a TurbineException and rethrown.
handleRequest
public void handleRequest(RunData data,
java.lang.String filename,
boolean isForward)
throws TurbineException
- Process the request
- Specified by:
handleRequest
in interface JspService
- Parameters:
RunData
- String
- the filename of the template.boolean
- whether to perform a forward or include.- Throws:
TurbineException
- Any exception trown while processing will be
wrapped into a TurbineException and rethrown.
templateExists
public boolean templateExists(java.lang.String template)
- Determine whether a given template exists. This service
currently only supports file base template hierarchies
so we will use the utility methods provided by
the template service to do the searching.
- Overrides:
templateExists
in class BaseTemplateEngineService
- Parameters:
String
- template- Returns:
- boolean
getRelativeTemplateName
public java.lang.String getRelativeTemplateName(java.lang.String template)
- Searchs for a template in the default.template path[s] and
returns the template name with a relative path which is
required by
javax.servlet.RequestDispatcher
- Specified by:
getRelativeTemplateName
in interface JspService
- Parameters:
String
- template- Returns:
- String
Copyright © 2000-2002 Apache Software Foundation. All Rights Reserved.