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
Field Summary |
private int |
bufferSize
The buffer size for the output stream. |
private java.lang.String[] |
relativeTemplatePaths
The relative path[s] prepended to filenames |
private java.lang.String[] |
templatePaths
The base path[s] prepended to filenames given in arguments |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
templatePaths
private java.lang.String[] templatePaths
- The base path[s] prepended to filenames given in arguments
relativeTemplatePaths
private java.lang.String[] relativeTemplatePaths
- The relative path[s] prepended to filenames
bufferSize
private int bufferSize
- The buffer size for the output stream.
TurbineJspService
public TurbineJspService()
init
public void init(javax.servlet.ServletConfig config)
throws InitializationException
- Performs early initialization of this Turbine service.
- Overrides:
init
in class TurbineBaseService
- Following copied from class:
org.apache.turbine.services.TurbineBaseService
- Parameters:
config
- A ServletConfing to use for initialization
activities.- Throws:
InitializationException,
- if initialization of this
class was not successful.
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.
initJsp
private void initJsp()
throws java.lang.Exception
- This method sets up the template cache.
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
- Parameters:
String
- template- Returns:
- String
Copyright © 1999-2001 Apache Software Foundation. All Rights Reserved.