rwlogo
HydraExpress 4.6

HydraExpress C++ API Reference Guide


   


Rogue Wave web site:  Home Page  |  Main Documentation Page

rwsf::RequestDispatcher Class Reference
[Servlet]

Dispatches requests to other resources. More...

#include <rwsf/servlet/RequestDispatcher.h>

Inheritance diagram for rwsf::RequestDispatcher:
rwsf::HandleBase

List of all members.

Public Member Functions

 RequestDispatcher ()
 RequestDispatcher (const RequestDispatcher &second)
virtual ~RequestDispatcher ()
RequestDispatcheroperator= (const RequestDispatcher &rhs)
void forward (rwsf::ServletRequest &request, rwsf::ServletResponse &response)
void include (rwsf::ServletRequest &request, rwsf::ServletResponse &response)

Detailed Description

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.

Note:
This implementation supports dispatching to other servlets in the same Agent and dispatching to HTTP resources. Direct dispatch to servlets in another Agent is not supported.

Constructor & Destructor Documentation

rwsf::RequestDispatcher::RequestDispatcher (  ) 

Creates an empty, invalid request dispatcher. Use the copy constructor or assignment operator to create a valid request dispatcher.

rwsf::RequestDispatcher::RequestDispatcher ( const RequestDispatcher second  ) 

Creates a new RequestDispatcher handle to the body instance of second.

virtual rwsf::RequestDispatcher::~RequestDispatcher (  )  [virtual]

Detaches from the current body (if any), decrements the reference count of the body, and deletes the body if there are no other references.


Member Function Documentation

void rwsf::RequestDispatcher::forward ( rwsf::ServletRequest request,
rwsf::ServletResponse response 
)

Forwards request and response to another resource. The other resource can be another servlet within the Agent, a static file in one of the Agent contexts, or a remote resource available through HTTP. Clears the response buffer before forwarding request and response.

void rwsf::RequestDispatcher::include ( rwsf::ServletRequest request,
rwsf::ServletResponse response 
)

Includes the response from another resource into the response for this servlet. The other resource can be another servlet within the Agent, a static file in one of the Agent contexts, or a remote resource available through HTTP. Does not clear the response buffer before forwarding request and response.

RequestDispatcher& rwsf::RequestDispatcher::operator= ( const RequestDispatcher rhs  ) 

Associates this handle with the rhs body instance. Returns a reference to self.


Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo are registered trademarks of Rogue Wave Software, and HydraExpress is a trademark of Rogue Wave Software. All other trademarks are the property of their respective owners.