Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
HydraExpress Servlet Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

rwsf::HttpServlet

Package:  Servlet


rwsf::HttpServlet rwsf::GenericServlet rwsf::Servlet

Local Index

Members

Header File

#include <rwsf/servlet/http/HttpServlet.h>

Description

rwsf::HttpServlet is a base class for servlets that use the HTTP protocol. A typical servlet derives from this class and overrides one or more of the do...() methods. A derived class should override at least one of the following methods:

A servlet differs from most C++ classes in that the servlet should not acquire resources in the constructor and should not release resources in the destructor. Instead, a servlet acquires resources in an init() function and releases resources in a destroy() function. The Agent always calls init() before forwarding requests to the servlet and always calls destroy() when the servlet is removed from service. However, the Agent may construct the servlet before the servlet is needed, and may take the servlet out of service long before the servlet is destroyed. A servlet can take advantage of this situation by deferring resource acquisition until the Agent calls init() and releasing resources as soon as the Agent calls destroy().

By default, multiple threads may execute inside the servlet at the same time. A multithreaded servlet must guard shared resources.

The servlet deployment descriptor can state that the servlet only allows access to one thread at a time. In this case, the Agent guards access to the servlet to guarantee that only one thread enters the servlet at a time. To only allow one thread at a time to execute within a servlet, set the single-threaded attribute on the servlet element to true, as shown below:

Note that the servlet is still a multithreaded process. Even though only one thread enters the servlet at a time, other threads in the Agent will still be able to service requests in other servlets.

Public Constructors

HttpServlet();

Public Destructor

virtual
~HttpServlet();

Public Member Functions

virtual void 
service(rwsf::ServletRequest& request, 
        rwsf::ServletResponse& response);

Protected Member Functions

virtual void 
doDelete(rwsf::HttpServletRequest& request, 
         rwsf::HttpServletResponse& response);
virtual void 
doGet(rwsf::HttpServletRequest& request, 
      rwsf::HttpServletResponse& response);
virtual void 
doHead(rwsf::HttpServletRequest& request, 
       rwsf::HttpServletResponse& response);
virtual void 
doOptions(rwsf::HttpServletRequest& request,
          rwsf::HttpServletResponse& response);
virtual void 
doPost(rwsf::HttpServletRequest& request,
       rwsf::HttpServletResponse& response);
virtual void 
doPut(rwsf::HttpServletRequest& request,
      rwsf::HttpServletResponse& response);
virtual void 
doTrace(rwsf::HttpServletRequest& request,
        rwsf::HttpServletResponse& response);
virtual rwsf::DateTime
getLastModified(rwsf::HttpServletRequest& request) const;
virtual void 
service(rwsf::HttpServletRequest& request,
        rwsf::HttpServletResponse& response);

See Also

rwsf::GenericServlet

rwsf::HttpServletRequest

rwsf::HttpServletResponse



Previous fileTop of DocumentContentsIndex pageNext file

©2004-2007 Copyright Quovadx, Inc. All Rights Reserved.
Quovadx and Rogue Wave are registered trademarks of Quovadx, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.