com.boylesoftware.cb2.admin.servlet
Class AdminServlet

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended bycom.boylesoftware.cb2.admin.servlet.AdminServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public final class AdminServlet
extends javax.servlet.http.HttpServlet

Servlet, which displays the CB2 Application Status/Administration page and processes adminitstrative actions submitted from it.

In order to access the servlet you must define it in the web.xml file of your web-application and map it to a URL ending with /cb2-admin. Below is an example:

 ...
 <web-app>
   ...
   <servlet>
     <servlet-name>admin</servlet-name>
     <display-name>The CB2 Application Status/Admin Page</display-name>
     <servlet-class>com.boylesoftware.cb2.admin.servlet.AdminServlet</servlet-class>
     <!-- load it AFTER the main controller servlet -->
     <load-on-startup>15</load-on-startup>
   </servlet>
   ...
   <servlet-mapping>
     <servlet-name>admin</servlet-name>
     <url-pattern>/cb2-admin</url-pattern>
   </servlet-mapping>
   ...
 </web-app>
 

Note that it is very important that this servlet is loaded AFTER the main action servlet, because in its initialization it counts on the fact that the application context and all subsystems are already initialized.

Note also, that it is usually a good idea to restrict access to this servlet, especially in production environments.

Version:
$Id: AdminServlet.java,v 1.12 2004/04/30 18:54:09 levahim Exp $
Author:
Lev Himmelfarb
See Also:
Serialized Form

Constructor Summary
AdminServlet()
           
 
Method Summary
 void destroy()
          Called when the servlet goes out of service.
protected  void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Handles a GET request.
 void init()
          Initializes the servlet.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, 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

AdminServlet

public AdminServlet()
Method Detail

init

public void init()
          throws javax.servlet.UnavailableException
Initializes the servlet.

Throws:
javax.servlet.UnavailableException

destroy

public void destroy()
Called when the servlet goes out of service.


doGet

protected void doGet(javax.servlet.http.HttpServletRequest request,
                     javax.servlet.http.HttpServletResponse response)
              throws javax.servlet.ServletException,
                     java.io.IOException
Handles a GET request.

Parameters:
request - the HTTP request.
response - the HTTP response.
Throws:
javax.servlet.ServletException - if an error happened during the request processing.
java.io.IOException - if an input/output error has happened during the request processing.


Copyright © 2002,2003,2004 - Boyle Software, Inc.