|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.servlet.GenericServlet javax.servlet.http.HttpServlet org.apache.turbine.Turbine
Turbine is the main servlet for the entire system. It is final
because you should not ever need to subclass this servlet. If you
need to perform initialization of a service, then you should implement the
Services API and let your code be initialized by it.
If you need to override something in the doGet()
or
doPost()
methods, edit the TurbineResources.properties file and
specify your own classes there.
Turbine servlet recognizes the following initialization parameters.
properties
the path to TurbineResources.properties file
used by the default implementation of ResourceService
, relative
to the application root.basedir
this parameter is used only if your
application server does not support web applications, or the or does not
support ServletContext.getRealPath(String)
method correctly.
You can use this parameter to specify the directory within the server's
filesystem, that is the base of your web application.
Field Summary | |
static java.lang.String |
BASEDIR_KEY
The base directory key |
static java.lang.String |
REDIRECTED_PATHINFO_NAME
Name of path info parameter used to indicate the redirected stage of a given user's initial Turbine request |
Constructor Summary | |
Turbine()
|
Method Summary | |
void |
destroy()
The Servlet destroy method. |
void |
doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
The primary method invoked when the Turbine servlet is executed. |
void |
doPost(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
In this application doGet and doPost are the same thing. |
protected static java.lang.String |
findInitParameter(javax.servlet.ServletContext context,
javax.servlet.ServletConfig config,
java.lang.String name,
java.lang.String defaultValue)
Finds the specified servlet configuration/initialization parameter, looking first for a servlet-specific parameter, then for a global parameter, and using the provided default if not found. |
static java.lang.String |
getApplicationRoot()
Get the application root for this Turbine webapp. |
static org.apache.commons.configuration.Configuration |
getConfiguration()
Return the current configuration with all keys included |
static java.lang.String |
getContextPath()
Return the context path. |
static ServerData |
getDefaultServerData()
Return all the Turbine Servlet information (Server Name, Port, Scheme in a ServerData structure. |
static java.lang.String |
getRealPath(java.lang.String path)
Used to get the real path of configuration and resource information. |
static java.lang.String |
getScriptName()
Get the script name. |
static java.lang.String |
getServerName()
Return the server name. |
static java.lang.String |
getServerPort()
Return the server port. |
static java.lang.String |
getServerScheme()
Return the server scheme. |
java.lang.String |
getServletInfo()
Return the servlet info. |
static javax.servlet.ServletConfig |
getTurbineServletConfig()
Get the servlet config for this turbine webapp. |
static javax.servlet.ServletContext |
getTurbineServletContext()
Get the servlet context for this turbine webapp. |
void |
init()
This init method will load the default resources from a properties file. |
void |
init(RunData data)
Initializes the services which need RunData to
initialize themselves (post startup). |
static void |
saveServletInfo(RunData data)
Save some information about this servlet so that it can be utilized by object instances that do not have direct access to RunData. |
static void |
setApplicationRoot(java.lang.String val)
Set the application root for the webapp. |
static void |
setTurbineServletConfig(javax.servlet.ServletConfig config)
Set the servlet config for this turbine webapp. |
static void |
setTurbineServletContext(javax.servlet.ServletContext context)
Set the servlet context for this turbine webapp. |
Methods inherited from class javax.servlet.http.HttpServlet |
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service |
Methods inherited from class javax.servlet.GenericServlet |
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, log, log |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String REDIRECTED_PATHINFO_NAME
public static final java.lang.String BASEDIR_KEY
Constructor Detail |
public Turbine()
Method Detail |
public final void init() throws javax.servlet.ServletException
javax.servlet.ServletException
- a servlet exception.protected static final java.lang.String findInitParameter(javax.servlet.ServletContext context, javax.servlet.ServletConfig config, java.lang.String name, java.lang.String defaultValue)
public final void init(RunData data)
RunData
to
initialize themselves (post startup).
data
- The first GET
request.public static org.apache.commons.configuration.Configuration getConfiguration()
public static java.lang.String getServerName()
public static java.lang.String getServerScheme()
public static java.lang.String getServerPort()
public static java.lang.String getScriptName()
public static java.lang.String getContextPath()
public static ServerData getDefaultServerData()
public static void setTurbineServletConfig(javax.servlet.ServletConfig config)
config
- New servlet configpublic static javax.servlet.ServletConfig getTurbineServletConfig()
public static void setTurbineServletContext(javax.servlet.ServletContext context)
context
- New servlet context.public static javax.servlet.ServletContext getTurbineServletContext()
public final void destroy()
Servlet
destroy method. Invokes
ServiceBroker
tear down method.
destroy
in interface javax.servlet.Servlet
public final void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws java.io.IOException, javax.servlet.ServletException
req
- Servlet request.res
- Servlet response.
java.io.IOException
- a servlet exception.
javax.servlet.ServletException
- a servlet exception.public final void doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws java.io.IOException, javax.servlet.ServletException
req
- Servlet request.res
- Servlet response.
java.io.IOException
- a servlet exception.
javax.servlet.ServletException
- a servlet exception.public final java.lang.String getServletInfo()
getServletInfo
in interface javax.servlet.Servlet
public static void saveServletInfo(RunData data)
data
- public static void setApplicationRoot(java.lang.String val)
val
- New app root.public static java.lang.String getApplicationRoot()
public static java.lang.String getRealPath(java.lang.String path)
path
- path translated to the application root
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |