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:
  1. The HttpServlet class has to implement the interface StatusPageHandler.StatusDataCallback. Thus it has to provide the StatusPageHandler_updateStatusData(boolean) function. It is called each time the status page is to be printed.
  2. The HttpServlet class has to define a member variable (and an instance) of the class StatusPageHandler.
  3. The HttpServlet class has to define a member variable (and an instance) of the class StatusData.
  4. The HttpServlet class has to implement the StatusPageHandler_updateStatusData(boolean) function. This function updates the StatusData object and returns it.
  5. The HttpServlet class has to forward the HTTP requests to the service(Object, Object) function.
The status page is displayed by a call to "MyServlet?__cmd__=status". If "&__mode__=text" is appended, the status page is printed in text format.
  • Constructor Summary

    Constructors 
    Constructor Description
    StatusPageServletExample()  
  • Method Summary

    Modifier and Type Method Description
    void destroy()  
    void init​(java.lang.Object config)  
    protected void service​(java.lang.Object request, java.lang.Object response)  
    StatusData StatusPageHandler_updateStatusData​(boolean isAuth)
    Update status data.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait