Package 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.
-
-
Field Summary
-
Fields inherited from class org.apache.turbine.services.BaseService
name, serviceBroker
-
Fields inherited from class org.apache.turbine.services.BaseInitable
initableBroker, isInitialized
-
Fields inherited from interface org.apache.turbine.services.jsp.JspService
BUFFER_SIZE_DEFAULT, BUFFER_SIZE_KEY, JSP_EXTENSION, LINK, PIPELINE_DATA, SERVICE_NAME, TEMPLATE_PATH_KEY
-
Fields inherited from interface org.apache.turbine.services.Service
SERVICE_NAME
-
Fields inherited from interface org.apache.turbine.services.template.TemplateEngineService
DEFAULT_ERROR_SCREEN, DEFAULT_LAYOUT, DEFAULT_LAYOUT_TEMPLATE, DEFAULT_NAVIGATION, DEFAULT_NAVIGATION_TEMPLATE, DEFAULT_PAGE, DEFAULT_SCREEN, DEFAULT_SCREEN_TEMPLATE, DEFAULT_TEMPLATE_EXTENSION, TEMPLATE_EXTENSIONS
-
-
Constructor Summary
Constructors Constructor Description TurbineJspService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDefaultObjects(PipelineData pipelineData)
Adds some convenience objects to the request.int
getDefaultBufferSize()
Returns the default buffer size of the JspServiceString
getRelativeTemplateName(String template)
Searches for a template in the default.template path[s] and returns the template name with a relative path which is required by javax.servlet.RequestDispatchervoid
handleRequest(PipelineData pipelineData, String templateName)
executes the JSP given by templateName.void
handleRequest(PipelineData pipelineData, String templateName, boolean isForward)
executes the JSP given by templateName.void
init()
Load all configured components and initialize them.boolean
templateExists(String template)
Determine whether a given template is available on the configured template pathes.-
Methods inherited from class org.apache.turbine.services.template.BaseTemplateEngineService
getAssociatedFileExtensions, getTemplateEngineServiceConfiguration, initConfiguration, registerConfiguration
-
Methods inherited from class org.apache.turbine.services.TurbineBaseService
init, init, shutdown
-
Methods inherited from class org.apache.turbine.services.BaseService
getConfiguration, getName, getProperties, getServiceBroker, setName, setServiceBroker
-
Methods inherited from class org.apache.turbine.services.BaseInitable
getInit, getInitableBroker, setInit, setInitableBroker
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.turbine.services.Initable
getInit, init, setInitableBroker, shutdown
-
Methods inherited from interface org.apache.turbine.services.Service
getConfiguration, getName, getProperties, setName, setServiceBroker
-
-
-
-
Constructor Detail
-
TurbineJspService
public TurbineJspService()
-
-
Method Detail
-
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 interfaceInitable
- Overrides:
init
in classTurbineBaseService
- Throws:
InitializationException
- Something went wrong in the init stage
-
addDefaultObjects
public void addDefaultObjects(PipelineData pipelineData)
Adds some convenience objects to the request. For example an instance of TemplateLink which can be used to generate links to other templates.- Specified by:
addDefaultObjects
in interfaceJspService
- Parameters:
pipelineData
- the Turbine PipelineData object
-
getDefaultBufferSize
public int getDefaultBufferSize()
Returns the default buffer size of the JspService- Specified by:
getDefaultBufferSize
in interfaceJspService
- Returns:
- The default buffer size.
-
handleRequest
public void handleRequest(PipelineData pipelineData, String templateName, boolean isForward) throws TurbineException
executes the JSP given by templateName.- Specified by:
handleRequest
in interfaceJspService
- Parameters:
pipelineData
- A PipelineData ObjecttemplateName
- The template to executeisForward
- whether to perform a forward or include.- Throws:
TurbineException
- If a problem occurred while executing the JSP
-
handleRequest
public void handleRequest(PipelineData pipelineData, String templateName) throws TurbineException
executes the JSP given by templateName.- Specified by:
handleRequest
in interfaceJspService
- Parameters:
pipelineData
- A PipelineData ObjecttemplateName
- The template to execute- Throws:
TurbineException
- If a problem occurred while executing the JSP
-
templateExists
public boolean templateExists(String template)
Determine whether a given template is available on the configured template pathes.- Specified by:
templateExists
in interfaceTemplateEngineService
- Specified by:
templateExists
in classBaseTemplateEngineService
- Parameters:
template
- The name of the requested Template- Returns:
- True if the template is available.
- See Also:
TemplateEngineService.templateExists(java.lang.String)
-
getRelativeTemplateName
public String getRelativeTemplateName(String template)
Searches 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 interfaceJspService
- Parameters:
template
- the name of the template- Returns:
- String
-
-