> This is main function of the application that is called when it is matched
> according to the regular expression in the applications_pool class.
> By default, main calls dispatcher().dispatch(url). And if the last fails,
> it creates 404 Error page.
Very simply.
That is the implementation of cppcms::application::main(std::string)
exactly according to this description
void application::main(std::string url)
{
if(!dispatcher().dispatch(url)) {
response().make_error_response(http::response::not_found);
}
}
So just reimplement it the way you want.
Additionally you can just do following:
dispatcher().assign(".*",&myclass::my404,this)
And make sure it is the last URL you add to the list.
Artyom
|