Package de.elo.utils.webapp.status
Class StatusPageServletExample
java.lang.Object
de.elo.utils.webapp.status.StatusPageServletExample
- All Implemented Interfaces:
StatusPageHandler.StatusDataCallback
public class StatusPageServletExample extends java.lang.Object implements StatusPageHandler.StatusDataCallback
This example shows how to use the
StatusPageHandler and StatusData classes.
Hint: In order to keep the javautils.jar independent from servlet-api.jar, references to HttpServlet, HttpServletRequest and HttpServletResponse are replaced by java.lang.Object. A real Servlet class has to be derived from HttpServlet.
The following list shows how to use the status page classes:-
The HttpServlet class has to implement the interface
StatusPageHandler.StatusDataCallback. Thus it has to provide theStatusPageHandler_updateStatusData(boolean)function. It is called each time the status page is to be printed. -
The HttpServlet class has to define a member variable (and an instance) of the class
StatusPageHandler. -
The HttpServlet class has to define a member variable (and an instance) of the class
StatusData. -
The HttpServlet class has to implement the
StatusPageHandler_updateStatusData(boolean)function. This function updates theStatusDataobject and returns it. -
The HttpServlet class has to forward the HTTP requests to the
service(Object, Object)function.
-
Constructor Summary
Constructors Constructor Description StatusPageServletExample() -
Method Summary
Modifier and Type Method Description voiddestroy()voidinit(java.lang.Object config)protected voidservice(java.lang.Object request, java.lang.Object response)StatusDataStatusPageHandler_updateStatusData(boolean isAuth)Update status data.
-
Constructor Details
-
StatusPageServletExample
public StatusPageServletExample()
-
-
Method Details
-
init
public void init(java.lang.Object config) -
destroy
public void destroy() -
service
protected void service(java.lang.Object request, java.lang.Object response) throws java.io.IOException- Throws:
java.io.IOException
-
StatusPageHandler_updateStatusData
Description copied from interface:StatusPageHandler.StatusDataCallbackUpdate status data. This function is called before the status page is printed.- Specified by:
StatusPageHandler_updateStatusDatain interfaceStatusPageHandler.StatusDataCallback- Parameters:
isAuth- authentication was successful- Returns:
- statusData Status data
- Throws:
java.io.IOException
-