| javax.servlet.http.HttpServlet org.apache.turbine.Turbine
Turbine | public class Turbine extends HttpServlet implements TurbineConstants(Code) | | 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.
author: Jon S. Stevens author: Brett McLaughlin author: Greg Ritter author: John D. McNally author: Frank Y. Kim author: Rafal Krzewski author: Jason van Zyl author: Sean Legassick author: Martin Poeschl author: Henning P. Schmiedehausen author: Quinton McCombs author: Eric Pugh author: Scott Eade version: $Id: Turbine.java 543399 2007-06-01 06:15:17Z seade $ |
Method Summary | |
final public void | destroy() The Servlet destroy method. | final public void | doGet(HttpServletRequest req, HttpServletResponse res) The primary method invoked when the Turbine servlet is executed. | final public void | doPost(HttpServletRequest req, HttpServletResponse res) In this application doGet and doPost are the same thing. | final protected static String | findInitParameter(ServletContext context, ServletConfig config, String name, 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. | public static String | getApplicationRoot() Get the application root for this Turbine webapp. | public static Configuration | getConfiguration() | public static String | getContextPath() Return the context path. | public static ServerData | getDefaultServerData() Return all the Turbine Servlet information (Server Name, Port,
Scheme in a ServerData structure. | public static String | getRealPath(String path) Used to get the real path of configuration and resource
information. | public static String | getScriptName() Get the script name. | public static String | getServerName() Return the server name. | public static String | getServerPort() Return the server port. | public static String | getServerScheme() Return the server scheme. | final public String | getServletInfo() Return the servlet info. | public static ServletConfig | getTurbineServletConfig() Get the servlet config for this turbine webapp. | public static ServletContext | getTurbineServletContext() Get the servlet context for this turbine webapp. | final public void | init() This init method will load the default resources from a
properties file. | final public void | init(RunData data) Initializes the services which need RunData to
initialize themselves (post startup). | public static synchronized 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. | public static void | setApplicationRoot(String val) Set the application root for the webapp. | public static void | setTurbineServletConfig(ServletConfig config) Set the servlet config for this turbine webapp. | public static void | setTurbineServletContext(ServletContext context) Set the servlet context for this turbine webapp. |
BASEDIR_KEY | final public static String BASEDIR_KEY(Code) | | The base directory key
|
REDIRECTED_PATHINFO_NAME | final public static String REDIRECTED_PATHINFO_NAME(Code) | | Name of path info parameter used to indicate the redirected stage of
a given user's initial Turbine request
|
destroy | final public void destroy()(Code) | | The Servlet destroy method. Invokes
ServiceBroker tear down method.
|
findInitParameter | final protected static String findInitParameter(ServletContext context, ServletConfig config, String name, String defaultValue)(Code) | | 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.
|
getApplicationRoot | public static String getApplicationRoot()(Code) | | Get the application root for this Turbine webapp. This
concept was started in 3.0 and will allow an app to be
developed from a standard CVS layout. With a simple
switch the app will work fully within the servlet
container for deployment.
String applicationRoot |
getConfiguration | public static Configuration getConfiguration()(Code) | | Return the current configuration with all keys included
a Configuration Object |
getContextPath | public static String getContextPath()(Code) | | Return the context path.
String context path |
getDefaultServerData | public static ServerData getDefaultServerData()(Code) | | Return all the Turbine Servlet information (Server Name, Port,
Scheme in a ServerData structure. This is generated from the
values set when initializing the Turbine and may not be correct
if you're running in a clustered structure. You can provide default
values in your configuration for cases where access is requied before
your application is first accessed by a user. This might be used
if you need a DataURI and have no RunData object handy.
An initialized ServerData object |
getRealPath | public static String getRealPath(String path)(Code) | | Used to get the real path of configuration and resource
information. This can be used by an app being
developed in a standard CVS layout.
Parameters: path - path translated to the application root the real path |
getScriptName | public static String getScriptName()(Code) | | Get the script name. This is the initial script name.
Actually this is probably not needed any more. I'll
check. jvz.
String initial script name. |
getServerName | public static String getServerName()(Code) | | Return the server name.
String server name |
getServerPort | public static String getServerPort()(Code) | | Return the server port.
String server port |
getServerScheme | public static String getServerScheme()(Code) | | Return the server scheme.
String server scheme |
getServletInfo | final public String getServletInfo()(Code) | | Return the servlet info.
a string with the servlet information. |
getTurbineServletConfig | public static ServletConfig getTurbineServletConfig()(Code) | | Get the servlet config for this turbine webapp.
ServletConfig |
getTurbineServletContext | public static ServletContext getTurbineServletContext()(Code) | | Get the servlet context for this turbine webapp.
ServletContext |
init | final public void init() throws ServletException(Code) | | This init method will load the default resources from a
properties file.
This method is called by init(ServletConfig config)
exception: ServletException - a servlet exception. |
init | final public void init(RunData data)(Code) | | Initializes the services which need RunData to
initialize themselves (post startup).
Parameters: data - The first GET request. |
saveServletInfo | public static synchronized void saveServletInfo(RunData data)(Code) | | Save some information about this servlet so that
it can be utilized by object instances that do not
have direct access to RunData.
Parameters: data - |
setApplicationRoot | public static void setApplicationRoot(String val)(Code) | | Set the application root for the webapp.
Parameters: val - New app root. |
setTurbineServletConfig | public static void setTurbineServletConfig(ServletConfig config)(Code) | | Set the servlet config for this turbine webapp.
Parameters: config - New servlet config |
setTurbineServletContext | public static void setTurbineServletContext(ServletContext context)(Code) | | Set the servlet context for this turbine webapp.
Parameters: context - New servlet context. |
Methods inherited from javax.servlet.http.HttpServlet | protected void doDelete(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doHead(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doOptions(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doPut(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doTrace(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected long getLastModified(HttpServletRequest req)(Code)(Java Doc) protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException(Code)(Java Doc)
|
|
|