HydraExpress™ C++ API Reference Guide

Product Documentation:
   HydraExpress C++
Documentation Home
List of all members | Public Member Functions
rwsf::RequestDispatcher Class Reference

Dispatches requests to other resources. More...

#include <rwsf/servlet/RequestDispatcher.h>

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

Public Member Functions

 RequestDispatcher ()
 
 RequestDispatcher (const RequestDispatcher &second)
 
virtual ~RequestDispatcher ()
 
void forward (rwsf::ServletRequest &request, rwsf::ServletResponse &response)
 
void include (rwsf::ServletRequest &request, rwsf::ServletResponse &response)
 
RequestDispatcheroperator= (const RequestDispatcher &rhs)
 
- Public Member Functions inherited from rwsf::HandleBase
bool isValid (void) const
 
bool operator!= (const HandleBase &second) const
 
bool operator== (const HandleBase &second) const
 

Additional Inherited Members

- Protected Member Functions inherited from rwsf::HandleBase
 HandleBase (void)
 
 HandleBase (StaticCtor)
 
 HandleBase (BodyBase *body)
 
 HandleBase (const HandleBase &second)
 
virtual ~HandleBase (void)
 
BodyBase & body (void) const
 
HandleBaseoperator= (const HandleBase &second)
 

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 © 2019 Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is registered trademark of Rogue Wave Software, Inc. in the United States and other countries, and HydraExpress is a trademark of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.