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, Henning P. Schmiedehausen

- - ### 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.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 and Description
    `TurbineJspService()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addDefaultObjects(PipelineData pipelineData)` Adds some convenience objects to the request.
    `int` | `getDefaultBufferSize()` Returns the default buffer size of the JspService
    `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
    `void` | `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.Service

      `getConfiguration, getName, getProperties, setName, setServiceBroker`

    - ### Methods inherited from interface org.apache.turbine.services.Initable

      `getInit, init, setInitableBroker, shutdown`

- - ### 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 interface `Initable`
      Overrides:
        `init` in class `TurbineBaseService`
      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 interface `JspService`
      Parameters:
        `pipelineData` - the Turbine PipelineData object

    - #### getDefaultBufferSize

          public int getDefaultBufferSize()

      Returns the default buffer size of the JspService
      Specified by:
        `getDefaultBufferSize` in interface `JspService`
      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 interface `JspService`
      Parameters:
        `pipelineData` - A PipelineData Object
        `templateName` - The template to execute
        `isForward` - 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 interface `JspService`
      Parameters:
        `pipelineData` - A PipelineData Object
        `templateName` - 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 interface `TemplateEngineService`
      Specified by:
        `templateExists` in class `BaseTemplateEngineService`
      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 interface `JspService`
      Parameters:
        `template` - the name of the template
      Returns:
        String

Copyright © 2000–2018 The Apache Software Foundation. All rights reserved.