Class TurbineServletService
java.lang.Object
org.apache.turbine.services.BaseInitable
org.apache.turbine.services.BaseService
org.apache.turbine.services.TurbineBaseService
org.apache.turbine.services.servlet.TurbineServletService
- All Implemented Interfaces:
- Initable,- Service,- ServletService
This class provides a context service when the application is run in a ServletContainer. It is mainly a wrapper around the ServletContext API.
This class requires Jakarta Servlet API 6.0 or better.
- Version:
- $Id$
- Author:
- Kevin A. Burton, Raphaƫl Luta, Jeff Brekke, Santiago Gala, Jason van Zyl, Jon S. Stevens
- 
Field SummaryFields inherited from class org.apache.turbine.services.BaseServiceconfiguration, name, serviceBrokerFields inherited from class org.apache.turbine.services.BaseInitableinitableBroker, isInitializedFields inherited from interface org.apache.turbine.services.ServiceSERVICE_NAMEFields inherited from interface org.apache.turbine.services.servlet.ServletServiceSERVICE_NAME
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionexpandRelative(String path) Expands a string that points to a relative path or path list, leaving it as an absolute path based on the servlet context.Returns the context path for this Turbine application.getRealPath(String uri) Returns the complete filesystem path for a given URIgetResource(String uri) Returns an URL object for a given URI string.Same as getResource except that it returns an InputStreamReturns the server name that this Turbine application is running on.Returns the port that this Turbine application is running through on the server.Returns the server scheme for this Turbine application.jakarta.servlet.ServletConfigReturns the servlet config used by this Turbine web application.jakarta.servlet.ServletContextReturns the servlet context used by this Turbine web application.voidinit()Load all configured components and initialize them.Methods inherited from class org.apache.turbine.services.TurbineBaseServiceinit, init, shutdownMethods inherited from class org.apache.turbine.services.BaseServicegetConfiguration, getName, getProperties, getServiceBroker, setName, setServiceBrokerMethods inherited from class org.apache.turbine.services.BaseInitablegetInit, getInitableBroker, setInit, setInitableBrokerMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.turbine.services.InitablegetInit, init, setInitableBroker, shutdownMethods inherited from interface org.apache.turbine.services.ServicegetConfiguration, getName, getProperties, setName, setServiceBroker
- 
Constructor Details- 
TurbineServletServicepublic TurbineServletService()
 
- 
- 
Method Details- 
initLoad all configured components and initialize them. This is a zero parameter variant which queries the Turbine Servlet for its config.- Specified by:
- initin interface- Initable
- Overrides:
- initin class- TurbineBaseService
 
- 
getResourceReturns an URL object for a given URI string. This URI is considered relative to the context.- Specified by:
- getResourcein interface- ServletService
- Parameters:
- uri- the URI to resolve as an URL
- Returns:
- an URL object or null is the uri is malformed or can't be resolved
- See Also:
 
- 
getResourceAsStreamSame as getResource except that it returns an InputStream- Specified by:
- getResourceAsStreamin interface- ServletService
- Parameters:
- uri- the URI to resolve
- Returns:
- an InputStream on the URI content or null
- See Also:
 
- 
getRealPathReturns the complete filesystem path for a given URI- Specified by:
- getRealPathin interface- ServletService
- Parameters:
- uri- the URI to resolve
- Returns:
- the full system path of this URI
- See Also:
 
- 
getServletConfigReturns the servlet config used by this Turbine web application.- Specified by:
- getServletConfigin interface- ServletService
- Returns:
- turbine servlet config
 
- 
getServletContextReturns the servlet context used by this Turbine web application.- Specified by:
- getServletContextin interface- ServletService
- Returns:
- turbine servlet context
 
- 
getServerSchemeReturns the server scheme for this Turbine application. This will either be http or https.- Specified by:
- getServerSchemein interface- ServletService
- Returns:
- String
 
- 
getServerNameReturns the server name that this Turbine application is running on.- Specified by:
- getServerNamein interface- ServletService
- Returns:
- String
 
- 
getServerPortReturns the port that this Turbine application is running through on the server.- Specified by:
- getServerPortin interface- ServletService
- Returns:
- String
 
- 
getContextPathReturns the context path for this Turbine application.- Specified by:
- getContextPathin interface- ServletService
- Returns:
- String
 
- 
expandRelativeExpands a string that points to a relative path or path list, leaving it as an absolute path based on the servlet context. It will return null if the text is empty or the config object is null.- Parameters:
- path- The String containing a path or path list.
- Returns:
- A String with the expanded path or path list.
 
 
-