[Cppcms-users] Create own 404 page
Brought to you by:
artyom-beilis
From: augustin <aug...@ov...> - 2010-08-25 12:26:13
|
Hello, How to create a custom 404 page. The doc says: virtual void cppcms::application::main ( std::string url ) [virtual] 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. This allows developers to create its own hooks for reaction on incoming URL as, initialization and cleanup of general resources, Custom 404 and error handlers etc. Reimplemented in cppcms::rpc::json_rpc_server. I don't understand the above explanation. Following the examples provided in the source, I make use of dispatcher().assign() within my application constructor. Thus myApplication::main() is no longer called at all. I fail to see how to use either myApplication::main() or myApplication::myApplication() or even disptacher().assign() to register a callback for 404 pages (or for any other codes, inc. access denied...). Augustin. -- Friends: http://www.reuniting.info/ http://activistsolutions.org/ My projects: http://astralcity.org/ http://3enjeux.overshoot.tv/ http://linux.overshoot.tv/ http://overshoot.tv/ http://charityware.info/ http://masquilier.org/ http://openteacher.info/ http://minguo.info/ http://www.wechange.org/ http://searching911.info/ . |