HydraExpress™ C++ API Reference Guide

 
Loading...
Searching...
No Matches
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 (BodyBase *body)
 HandleBase (const HandleBase &second)
 HandleBase (StaticCtor)
 HandleBase (void)
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

◆ RequestDispatcher() [1/2]

rwsf::RequestDispatcher::RequestDispatcher ( )

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

◆ RequestDispatcher() [2/2]

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

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

◆ ~RequestDispatcher()

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

◆ forward()

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.

◆ include()

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.

◆ operator=()

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

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

Copyright © 2026 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.