|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.apache.tapestry.ApplicationServlet
public class ApplicationServlet
Links a servlet container with a Tapestry application. The servlet init parameter
org.apache.tapestry.application-specification
should be set to the complete
resource path (within the classpath) to the application specification, i.e.,
/com/foo/bar/MyApp.application
. As of release 4.0, this servlet will also create
a HiveMind Registry and manage it.
ApplicationInitializer
,
ServletRequestServicer
,
Serialized FormConstructor Summary | |
---|---|
ApplicationServlet()
|
Method Summary | |
---|---|
protected void |
addModuleIfExists(org.apache.hivemind.impl.RegistryBuilder builder,
ServletContext context,
String path)
Looks for a file in the servlet context; if it exists, it is expected to be a HiveMind module descriptor, and is added to the builder. |
protected org.apache.hivemind.ErrorHandler |
constructErrorHandler(ServletConfig config)
Invoked by constructRegistry(ServletConfig) to create and return an
ErrorHandler instance to be used when constructing the Registry (and then to handle
any runtime exceptions). |
protected org.apache.hivemind.Registry |
constructRegistry(ServletConfig config)
Invoked from init(ServletConfig) to construct the Registry to be used by the
application. |
protected org.apache.hivemind.ClassResolver |
createClassResolver()
Invoked from init(ServletConfig) to create a resource resolver for the servlet
(which will utlimately be shared and used through the application). |
void |
destroy()
Shuts down the registry (if it exists). |
void |
doGet(HttpServletRequest request,
HttpServletResponse response)
Invokes doService(HttpServletRequest, HttpServletResponse) . |
void |
doPost(HttpServletRequest request,
HttpServletResponse response)
Invokes doService(HttpServletRequest, HttpServletResponse) . |
protected void |
doService(HttpServletRequest request,
HttpServletResponse response)
Handles the GET and POST requests. |
void |
init(ServletConfig config)
Reads the application specification when the servlet is first initialized. |
protected void |
initializeApplication()
Invoked from init(ServletConfig) , after the registry has been constructed, to
bootstrap the application via the tapestry.MasterApplicationInitializer
service. |
protected void |
show(Exception ex)
|
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, getServletInfo, getServletName, init, log, log |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ApplicationServlet()
Method Detail |
---|
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
doService(HttpServletRequest, HttpServletResponse)
.
doGet
in class HttpServlet
IOException
ServletException
protected void doService(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
Registry.setupThread()
ServletRequestServicer.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
.
IOException
ServletException
protected void show(Exception ex)
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
doService(HttpServletRequest, HttpServletResponse)
.
doPost
in class HttpServlet
IOException
ServletException
public void init(ServletConfig config) throws ServletException
engine instances
will have access to the specification via the servlet.
init
in interface Servlet
init
in class GenericServlet
ServletException
constructRegistry(ServletConfig)
,
createClassResolver()
protected org.apache.hivemind.ClassResolver createClassResolver()
init(ServletConfig)
to create a resource resolver for the servlet
(which will utlimately be shared and used through the application).
This implementation constructs a DefaultClassResolver
, subclasses may provide a
different implementation.
DefaultClassResolver
protected org.apache.hivemind.Registry constructRegistry(ServletConfig config)
init(ServletConfig)
to construct the Registry to be used by the
application.
This looks in the standard places (on the classpath), but also in the WEB-INF/name and WEB-INF folders (where name is the name of the servlet).
protected org.apache.hivemind.ErrorHandler constructErrorHandler(ServletConfig config)
constructRegistry(ServletConfig)
to create and return an
ErrorHandler
instance to be used when constructing the Registry (and then to handle
any runtime exceptions). This implementation returns a new instance of
StrictErrorHandler
.
protected void addModuleIfExists(org.apache.hivemind.impl.RegistryBuilder builder, ServletContext context, String path)
protected void initializeApplication()
init(ServletConfig)
, after the registry has been constructed, to
bootstrap the application via the tapestry.MasterApplicationInitializer
service.
public void destroy()
destroy
in interface Servlet
destroy
in class GenericServlet
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |