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

2.10 Servlet Classes

Table 9: Servlet Classes

Class NameDescription

rwsf::Cookie

rwsf::Cookie represents an HTTP cookie. A cookie is a small piece of data sent from the server to the client. The client stores the cookie and returns it to the server with later requests. Cookies are typically used to store a small amount of state on the client. If the application requires little state, cookies can maintain the complete state of the application. Otherwise, the application will save the application state on the server and send the client a cookie with a unique token. On later requests, the client returns the token. The application uses the token to associate the saved state with the request. This class provides a simple API for working with cookies.

rwsf::EventListener

rwsf::EventListener is the base class for all event listener classes in HydraExpress. A derived listener receives notification of specific events in the Agent. For example, the Agent notifies an rwsf::HttpSessionListener object when a session is created, destroyed, or modified.

rwsf::Filter

rwsf::Filter is the base class for filters. A filter processes the requests and responses for a resource. For example, a filter might compress or encode the response from a Web Service, transform an XML response into HTML, or adapt an incoming request.

rwsf::FilterChain

rwsf::FilterChain encapsulates a sequence of filters for a particular resource. Instances of rwsf::FilterChain are constructed by the Agent and passed to rwsf::Filter objects.

rwsf::FilterConfig

rwsf::FilterConfig contains the configuration information provided in the deployment descriptor of a given filter. After a filter is initialized, the filter accesses configuration information by using the getFilterConfig() method of rwsf::Filter. This class provides a function that returns the filter name, and inherits functions for working with initialization parameters and the filter context.

rwsf::GenericServlet

rwsf::GenericServlet is an abstract class that contains a basic framework for a C++ servlet. The class implements specific functionality beyond that offered by rwsf::Servlet. For flexibility, a servlet that does not service HTTP requests may derive from rwsf::GenericServlet and override the pure virtual service() function inherited from rwsf::Servlet.

rwsf::HttpServlet

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:

rwsf::HttpServletRequest

Extends rwsf::ServletRequest to provide request information for HTTP servlets. An HTTP servlet receives an rwsf::HttpServletRequest object for each request from a client. The request object contains the complete information in the request as well as any rwsf::HttpSession object associated with the request.

rwsf::HttpServletResponse

rwsf::HttpServletResponse provides an HTTP-specific response object and provides a method for accessing HTTP-specific functionality, such as cookies and HTTP headers. For each request from a client, an HTTP servlet receives an instance of rwsf::HttpServletReponse that represents the response to the request.

rwsf::HttpSession

rwsf::HttpSession provides a convenient interface for maintaining state across HTTP requests. The class allows access to information about a session, such as when the session was created and when the session was last accessed.

rwsf::HttpSessionBindingEvent

rwsf::HttpSessionBindingEvent encapsulates information about changes to sessions. The Agent passes an instance of this class to an rwsf::HttpSessionListener when a session adds an attribute, removes an attribute, or replaces an attribute. See class rwsf::HttpSessionListener for details on the session listener.

rwsf::HttpSessionEvent

rwsf::HttpSessionEvent provides access to a session when the Agent creates or destroys the session. When either event occurs, the Agent passes an instance of this class to an rwsf::HttpSessionListener. See class rwsf::HttpSessionListener for details on session listeners.

rwsf::HttpSessionListener

rwsf::HttpSessionListener is a base class for listeners that receive notification of HTTP session events. To create a listener, derive from this class and override the functions that receive the events of interest. To register a listener, include a deployment descriptor for the listener class in the configuration file of the context.

rwsf::RequestDispatcher

rwsf::RequestDispatcher forwards requests to other resources within the Agent or to a remote HTTP resource. Instances of this class are created by the Agent. The getNamedDispatcher() and getRequestDispatcher() functions of class rwsf::ServletContext provide access to rwsf::RequestDispatcher objects.

rwsf::Servlet

rwsf::Servlet is an abstract base class for servlets. A servlet is a small piece of code that executes inside an Agent running on a server. Users will typically use one of the derived classes for creating their own servlets. To create a generic servlet use the rwsf::GenericServlet class. To create a servlet that uses the HTTP protocol use rwsf::HttpServlet.

rwsf::ServletConfig

rwsf::ServletConfig holds servlet configuration information. The Agent passes an instance of this class to the init() method of a servlet.

rwsf::ServletContext

rwsf::ServletContext represents the web application context. The Agent constructs a single context object for each web application. Each context object contains application-wide initialization parameters, information about the deployment environment, and a collection of attributes. A context also provides factory methods for creating request dispatchers to redirect requests. A context can retrieve other context objects held by the server so objects in different applications can cooperate.

rwsf::ServletContextAttributeEvent

rwsf::ServletContextAttributeEvent encapsulates information about a change to an attribute within a servlet context. There is no need to instantiate this class. The Agent creates an instance of this class when an attribute is added, removed, or replaced.

rwsf::ServletContextAttributeListener

rwsf::ServletContextAttributeListener is an abstract base class for listeners that receive notification when attributes change on a given rwsf::ServletContext. To create a listener, derive from this class and override the functions that receive events. To register a listener, include a deployment descriptor for the listener class in the configuration file of the context.

rwsf::ServletContextEvent

rwsf::ServletContextEvent provides access to an rwsf::ServletContext when the Agent creates the context, when the Agent is about to destroy the context, or when attributes within the context change. When a context is created or destroyed, the Agent passes an instance of this class to rwsf::ServletContextListener objects within the Agent. When a context attribute changes, the Agent passes an instance of this class to rwsf::ServletContextAttributeListener objects within the Agent.

rwsf::ServletContextListener

rwsf::ServletContextListener is an abstract base class for listeners that receive notification when the Agent creates or destroys rwsf::ServletContext objects. To create a listener, derive from this class and override the functions that receive events. To register a listener, include a deployment descriptor for the listener class in the configuration file of the context.

rwsf::ServletException

rwsf::ServletException is the base class for Servlet Module exceptions.

rwsf::ServletMessageInfoHandlerImp

ServletMessageInfoHandlerImp implements the MessageInfoHandlerImp interface for dispatching messages to a Servlet container.

rwsf::ServletOutputStream

rwsf::ServletOutputStream provides a simple mechanism for writing a response. The class has a set of print() and println() functions which duplicate the corresponding methods in the Java ServletOutputStream class. A print() method writes the argument to the output stream. A println() method writes the argument and a newline to the output stream. Note that the print(bool) and println(bool) functions follow Java conventions and produce "true" and "false" rather than 1 and 0.

rwsf::ServletRequest

rwsf::ServletRequest encapsulates a request from a client. The Agent constructs an instance of this class for each request. The Agent populates the object with the details of the client request. The request object also contains an attribute collection that stores data created by objects in the Agent. For example, a filter might preprocess part of the request and store the results in an attribute for use by a servlet.

rwsf::ServletResponse

rwsf::ServletResponse encapsulates a response to a client. For each request, the Agent creates an instance of this object and passes the instance to the servlet's service() method. Each response object contains an output buffer that holds the response payload. The methods in this class allow a servlet to access and set buffer information.

rwsf::ServletUnavailableException

A servlet throws rwsf::ServletUnavailableException to indicate to the Agent that the servlet cannot process requests.



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.