[Cppcms-users] what is the integer in url_dispatcher::asign for?
Brought to you by:
artyom-beilis
From: Marcel H. <ke...@co...> - 2012-01-18 09:48:50
|
Hello everybody, I wonder about this method: http://art-blog.no-ip.info/cppcms_ref_v0_99/classcppcms_1_1url__dispatcher.html#a92c984612be4b29e9e45b58cbe676f77 this is (I think) the standard url assign method everybody uses. In the tutorial of url mapping ( http://cppcms.sourceforge.net/wikipp/en/page/cppcms_1x_tut_url_mapping ) it says: "In the fourth line we connect the regular expression |/number/(\d+)| to the member function |number| of |this| instance that receives |std::string| as parameter, and 1st captured subexpression is passed to it." (4: "dispatcher().assign("/number/(\\d+)", &hello::number, this, 1);" ) So i now think, what happens if you put instead of a 1 a 0 to the method, like in the "message_board" example: /message_board/apps/thread.cpp:174: dispatcher().assign(".*",&reply::prepare,this,0); And also some times ago our chinese/japanese (?) friend csfreebird posted some code like this: dispatcher().assign("/welcome" , &kaimei_web_site::welcome , this , 1); //first page dispatcher().assign("/register" , &kaimei_web_site::register_client , this , 2); //register a new account on this page .... //restful web method called by Javascript form client-side dispatcher().assign("/send_email" , &kaimei_web_site::save_email , this , 7); dispatcher().assign("/create_account?(.+)" , &kaimei_web_site::create_account , this , 8); I think this is wrong, isn't it? Hope of some clearness. Marcel Hellwig |