org.apache.turbine.services.servlet
Class TurbineServlet

java.lang.Object
  extended by org.apache.turbine.services.servlet.TurbineServlet

public class TurbineServlet
extends Object

Simple static accessor to the EngineContextService

Version:
$Id: TurbineServlet.java 1071044 2011-02-15 20:47:31Z tv $
Author:
Kevin A. Burton, Raphaƫl Luta, Jeff Brekke, Jason van Zyl

Constructor Summary
TurbineServlet()
           
 
Method Summary
static String getContextPath()
          Returns the context path for this Turbine application.
static String getRealPath(String path)
          Returns the complete filesystem path for a given URI
static URL getResource(String uri)
          Returns an URL object for a given URI string.
static InputStream getResourceAsStream(String uri)
          Same as getResource except that it returns an InputStream
static String getServerName()
          Returns the server name that this Turbine application is running on.
static String getServerPort()
          Returns the port that this Turbine application is running through on the server.
static String getServerScheme()
          Returns the server scheme for this Turbine application.
protected static ServletService getService()
          Utility method for accessing the service implementation
static javax.servlet.ServletConfig getServletConfig()
          Returns the servlet config used by this Turbine web application.
static javax.servlet.ServletContext getServletContext()
          Returns the servlet context used by this Turbine web application.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TurbineServlet

public TurbineServlet()
Method Detail

getService

protected static ServletService getService()
Utility method for accessing the service implementation

Returns:
a ServletService implementation instance

getResource

public static URL getResource(String uri)
Returns an URL object for a given URI string. This URI is considered relative to the context.

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

getResourceAsStream

public static InputStream getResourceAsStream(String uri)
Same as getResource except that it returns an InputStream

Parameters:
uri - the URI to resolve
Returns:
an InputStream on the URI content or null
See Also:
ServletContext.getResourceAsStream(java.lang.String)

getRealPath

public static String getRealPath(String path)
Returns the complete filesystem path for a given URI

Parameters:
uri - the URI to resolve
Returns:
the full system path of this URI
See Also:
ServletContext.getRealPath(java.lang.String)

getServletConfig

public static javax.servlet.ServletConfig getServletConfig()
Returns the servlet config used by this Turbine web application.

Returns:
turbine servlet config

getServletContext

public static javax.servlet.ServletContext getServletContext()
Returns the servlet context used by this Turbine web application.

Returns:
turbine servlet context

getServerScheme

public static String getServerScheme()
Returns the server scheme for this Turbine application. This will either be http or https.

Returns:
String

getServerName

public static String getServerName()
Returns the server name that this Turbine application is running on.

Returns:
String

getServerPort

public static String getServerPort()
Returns the port that this Turbine application is running through on the server.

Returns:
String

getContextPath

public static String getContextPath()
Returns the context path for this Turbine application.

Returns:
String


Copyright © 2000-2011 The Apache Software Foundation. All Rights Reserved.