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

rwsf::HttpServlet

Group:  Servlet


rwsf::HttpServletrwsf::GenericServlet

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 Destructors

virtual
~HttpServlet();

Public Member Functions

void
service(rwsf::ServletRequest & req,
    rwsf::ServletResponse & res);

Protected Member Functions

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


Previous fileTop of DocumentContentsIndex pageNext file

© Copyright Rogue Wave Software, Inc. All Rights Reserved. All Rights Reserved. Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. HydraExpress is a trademark of Rogue Wave Software, Inc. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.