WebForwardPage Class Reference
[Webserver]

A class for forwarding an URI to another URI. More...

#include <webforwardpage.h>

Inheritance diagram for WebForwardPage:

Inheritance graph
[legend]
Collaboration diagram for WebForwardPage:

Collaboration graph
[legend]
List of all members.

Public Member Functions

DECLSPEC WebForwardPage (const char *uri, const char *location)
DECLSPEC void setLocation (const char *l)
virtual DECLSPEC int send (WebSrvClient *client, Uint32 &responsecode)

Detailed Description

A class for forwarding an URI to another URI.

This class forwards a request to another location by sending a "Moved Permanently" response to the browser.


Constructor & Destructor Documentation

WebForwardPage::WebForwardPage ( const char *  uri,
const char *  location 
)

Constructor. Automatically registers itself to be accessible by HTTP requests.

Parameters:
uri the URI (after the IP address) of the page; when a HTTP request like http://IP-addr"uri" arrives, the function send() will be called. uri has to start with a '/' (slash)!
location the URI of the file, where the browser should look for the page. Can be relative, like "index.html", or absolute, like "http://192.168.0.1/websrv/index.html".


Member Function Documentation

void WebForwardPage::setLocation ( const char *  l  ) 

Changes the location of the aim.

Parameters:
l the URL to the aim. Can be absolute (i.e. "http://192.168.0.1/websrv/index.html") or relative (i.e. "index.html")

int WebForwardPage::send ( WebSrvClient *  client,
Uint32 &  responsecode 
) [virtual]

Use this function in derived classes to respond on requests.

Parameters:
client the connected client, that is requesting
responsecode the return-code of the page, sent to the client (i.e. 200, when OK; 400 on error...) has to be assigned to this variable
Returns:
the number of bytes sent to the client

Reimplemented from WebPage.


The documentation for this class was generated from the following files:
Generated on Wed May 9 17:36:37 2007 for netrinjo by  doxygen 1.5.1