Servlet Service

The Servlet Service encapsulates the information provided by the ServletContext API, and makes it available from anywhere in the code.

Configuration

# -------------------------------------------------------------------
#
#  S E R V I C E S
#
# -------------------------------------------------------------------
# Classes for Turbine Services should be defined here.
# Format: services.[name].classname=[implementing class]
#
# To specify properties of a service use the following syntax:
# service.[name].[property]=[value]

services.ServletService.classname=\
  org.apache.turbine.services.servlet.TurbineServletService
.
.
.

Usage

Upon initialization, this service remembers the servlet configuration for the application, and is able to provide back information about this configuration. After the service has been initialized, it supports the following functionality:

  • Create an URL from a URI string which is relative to the context.
  • Provide the complete filesystem path for a given URI.
  • Expand a string that points to a relative path or path list, leaving it as an absolute path based on the servlet context.