Apache application class. More...
#include <apache_application.h>


Public Member Functions | |
| apache_application () | |
| Constructor. | |
| virtual void | on_handle_request (on_request_handler handler) |
| Register a custom web request handler. | |
| virtual void | on_exception (on_exception_handler handler) |
| Register a custom exception handler. | |
Static Public Member Functions | |
| static void | apache_register_hooks (apr_pool_t *) |
Protected Member Functions | |
| virtual http_request | get_request () |
| virtual void | send_response (const http_response &response) |
Apache application class.
The apache web server is a most popular web server in the world. It supports extending with an own API by plugins (apache modules), which are dynamic libraries by nature.
This class implements the web aplication as the apache module (extension of the apache web server).
See the 'examples/hello_world/apache_module' directory for the apache module skeleton application based on apache_application class.
| virtual void dbp::apache_application::on_exception | ( | on_exception_handler | handler | ) | [inline, virtual] |
Register a custom exception handler.
By default, the web application returns the '500 Internal Server Error' HTTP error code on exceptions occured, but you can customize the default exceptions handling by registering your handler.
| handler | the exception handler delegate. |
Implements dbp::web_application_int.
| virtual void dbp::apache_application::on_handle_request | ( | on_request_handler | handler | ) | [inline, virtual] |
Register a custom web request handler.
To make your application doing something useful, you should register your web request handler.
This handler is a web application entry point. When client is passing the request, it comes to a web server, processed with it and delivers to the application. You can obtain web request fields via http_request parameter.
After processing of the request you should to deliver the appropriate response to a client via web server by returning initialized http_response object.
The 'examples/hello_world/cgi_application' directory contains the source code of the web request handler implementation example.
| handler | the request handler delegate. |
Implements dbp::web_application_int.