com.arsdigita.web
Class BaseServlet

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended bycom.arsdigita.web.BaseServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
Direct Known Subclasses:
BaseApplicationServlet, BaseJSP, DispatcherServlet, LegacyInitializerServlet, OIDRedirectServlet, ResourceServlet, VersioningServlet

public abstract class BaseServlet
extends javax.servlet.http.HttpServlet

The base servlet for CCM servlets. It manages database transactions, prepares an execution context for the request, and traps and handles requests to redirect.

Users of this class may implement doService(HttpServletRequest,HttpServletResponse) to service a request in this environment.

Version:
$Id: //core-platform/dev/src/com/arsdigita/web/BaseServlet.java#29 $
Author:
Justin Ross <jross@redhat.com>
See Also:
BaseApplicationServlet, BaseJSP, RedirectSignal, Serialized Form

Field Summary
static String REQUEST_URL_ATTRIBUTE
          The name of the request attribute used to store the originally requested URL.
static String versionId
           
 
Constructor Summary
BaseServlet()
           
 
Method Summary
 void destroy()
           
protected  void doDestroy()
           
protected  void doGet(javax.servlet.http.HttpServletRequest sreq, javax.servlet.http.HttpServletResponse sresp)
          Processes HTTP GET requests.
protected  void doInit()
           
protected  void doPost(javax.servlet.http.HttpServletRequest sreq, javax.servlet.http.HttpServletResponse sresp)
          Processes HTTP POST requests.
protected  void doService(javax.servlet.http.HttpServletRequest sreq, javax.servlet.http.HttpServletResponse sresp)
          The method that doGet(HttpServletRequest,HttpServletResponse) and doPost(HttpServletRequest,HttpServletResponse) call.
protected  UserContext getUserContext(javax.servlet.http.HttpServletRequest sreq, javax.servlet.http.HttpServletResponse sresp)
          Obtains a new user context from the http request parameters.
 void init(javax.servlet.ServletConfig sconfig)
           
 
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
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values

REQUEST_URL_ATTRIBUTE

public static final String REQUEST_URL_ATTRIBUTE
The name of the request attribute used to store the originally requested URL.

Constructor Detail

BaseServlet

public BaseServlet()
Method Detail

init

public void init(javax.servlet.ServletConfig sconfig)
          throws javax.servlet.ServletException
Throws:
javax.servlet.ServletException

doInit

protected void doInit()
               throws javax.servlet.ServletException
Throws:
javax.servlet.ServletException

destroy

public void destroy()

doDestroy

protected void doDestroy()

doService

protected void doService(javax.servlet.http.HttpServletRequest sreq,
                         javax.servlet.http.HttpServletResponse sresp)
                  throws javax.servlet.ServletException,
                         IOException

The method that doGet(HttpServletRequest,HttpServletResponse) and doPost(HttpServletRequest,HttpServletResponse) call. This is the extension point for users of this class.

Throws:
javax.servlet.ServletException
IOException

doGet

protected final void doGet(javax.servlet.http.HttpServletRequest sreq,
                           javax.servlet.http.HttpServletResponse sresp)
                    throws javax.servlet.ServletException,
                           IOException

Processes HTTP GET requests.

Throws:
javax.servlet.ServletException
IOException
See Also:
HttpServlet.doGet(HttpServletRequest,HttpServletResponse)

doPost

protected final void doPost(javax.servlet.http.HttpServletRequest sreq,
                            javax.servlet.http.HttpServletResponse sresp)
                     throws javax.servlet.ServletException,
                            IOException

Processes HTTP POST requests.

Throws:
javax.servlet.ServletException
IOException
See Also:
HttpServlet.doPost(HttpServletRequest,HttpServletResponse)

getUserContext

protected UserContext getUserContext(javax.servlet.http.HttpServletRequest sreq,
                                     javax.servlet.http.HttpServletResponse sresp)
Obtains a new user context from the http request parameters. NOTE: protected for use by web.ApplicaitonDispatchTest

Parameters:
sreq -
sresp -
Returns:
The user context


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 20 2004:2337 UTC