public class TurbineServletService extends TurbineBaseService implements 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 Servlet API 2.1 or better.
configuration, name, serviceBroker
initableBroker, isInitialized
SERVICE_NAME
Constructor and Description |
---|
TurbineServletService() |
Modifier and Type | Method and Description |
---|---|
String |
expandRelative(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.
|
String |
getContextPath()
Returns the context path for this
Turbine application.
|
String |
getRealPath(String uri)
Returns the complete filesystem path for a
given URI
|
URL |
getResource(String uri)
Returns an URL object for a given URI string.
|
InputStream |
getResourceAsStream(String uri)
Same as getResource except that it returns an InputStream
|
String |
getServerName()
Returns the server name that this
Turbine application is running
on.
|
String |
getServerPort()
Returns the port that this Turbine
application is running through
on the server.
|
String |
getServerScheme()
Returns the server scheme for this
Turbine application.
|
ServletConfig |
getServletConfig()
Returns the servlet config used by this
Turbine web application.
|
ServletContext |
getServletContext()
Returns the servlet context used by this
Turbine web application.
|
void |
init()
Load all configured components and initialize them.
|
init, init, shutdown
getConfiguration, getName, getProperties, getServiceBroker, setName, setServiceBroker
getInit, getInitableBroker, setInit, setInitableBroker
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getConfiguration, getName, getProperties, setName, setServiceBroker
getInit, init, setInitableBroker, shutdown
public TurbineServletService()
public void init()
init
in interface Initable
init
in class TurbineBaseService
public URL getResource(String uri)
getResource
in interface ServletService
uri
- the URI to resolve as an URLServletContext.getResource(java.lang.String)
public InputStream getResourceAsStream(String uri)
getResourceAsStream
in interface ServletService
uri
- the URI to resolveServletContext.getResourceAsStream(java.lang.String)
public String getRealPath(String uri)
getRealPath
in interface ServletService
uri
- the URI to resolveServletContext.getRealPath(java.lang.String)
public ServletConfig getServletConfig()
getServletConfig
in interface ServletService
public ServletContext getServletContext()
getServletContext
in interface ServletService
public String getServerScheme()
getServerScheme
in interface ServletService
public String getServerName()
getServerName
in interface ServletService
public String getServerPort()
getServerPort
in interface ServletService
public String getContextPath()
getContextPath
in interface ServletService
public String expandRelative(String path)
path
- The String containing a path or path list.Copyright © 2000–2019 The Apache Software Foundation. All rights reserved.