|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | 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.
resources
the implementation of
ResourceService
to be usedproperties
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 |
private static boolean |
firstDoGet
Should initialization activities be performed during doGet() execution? |
private static boolean |
firstInit
In certain situations the init() method is called more than once, somtimes even concurrently. |
private static java.lang.Throwable |
initFailure
Whether init succeeded or not. |
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 |
Fields inherited from class javax.servlet.http.HttpServlet |
HEADER_IFMODSINCE, HEADER_LASTMOD, LSTRING_FILE, lStrings, METHOD_DELETE, METHOD_GET, METHOD_HEAD, METHOD_OPTIONS, METHOD_POST, METHOD_PUT, METHOD_TRACE |
Fields inherited from class javax.servlet.GenericServlet |
config |
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. |
java.lang.String |
getServletInfo()
Return the servlet info. |
private void |
handleException(RunData data,
javax.servlet.http.HttpServletResponse res,
java.lang.Throwable t)
This method is about making sure that we catch and display errors to the screen in one fashion or another. |
void |
init(RunData data)
Initializes the services which need RunData to
initialize themselves (post startup). |
void |
init(javax.servlet.ServletConfig config)
This init method will load the default resources from a properties file. |
Methods inherited from class javax.servlet.http.HttpServlet |
|
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, registerNatives, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String REDIRECTED_PATHINFO_NAME
public static final java.lang.String BASEDIR_KEY
private static boolean firstInit
private static java.lang.Throwable initFailure
private static boolean firstDoGet
Constructor Detail |
public Turbine()
Method Detail |
public final void init(javax.servlet.ServletConfig config) throws javax.servlet.ServletException
init
in class javax.servlet.GenericServlet
config
- typical Servlet initialization parameter.javax.servlet.ServletException
- a servlet exception.public final void init(RunData data)
RunData
to
initialize themselves (post startup).data
- The first GET
request.public final void destroy()
Servlet
destroy method. Invokes
ServiceBroker
tear down method.destroy
in class javax.servlet.GenericServlet
public final void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws java.io.IOException, javax.servlet.ServletException
doGet
in class javax.servlet.http.HttpServlet
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
doPost
in class javax.servlet.http.HttpServlet
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 class javax.servlet.GenericServlet
private final void handleException(RunData data, javax.servlet.http.HttpServletResponse res, java.lang.Throwable t)
data
- A Turbine RunData object.res
- Servlet response.e
- The exception to report.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |