Re: [Cppcms-users] What exactly url_mapper does?
Brought to you by:
artyom-beilis
|
From: Artyom B. <art...@ya...> - 2011-08-04 19:21:59
|
----- Original Message -----
> From: Abhishek Kaushik <abh...@gm...>
> To: cpp...@li...
> Cc:
> Sent: Thursday, August 4, 2011 5:22 PM
> Subject: Re: [Cppcms-users] What exactly url_mapper does?
>
>
>
> For Example:
>
>
> flat_thread::flat_thread(cppcms::service &s)
> : thread_shared(s)
> {
> dispatcher().assign(".*",&flat_thread::prepare,this,0);
> mapper().assign("{1}");
> }
>
> Here I am not able to understand the role of
> mapper().assign("{1}") I able to understand
> dispatcher().assign()
> is trying to assign the matched urls
> to prepare function of flat thread with 0th parameter.
>
> Is mapper().assign() ignorable here?
>
> Please enlighten :(
> thanks
> Abhishek Kaushik
>
>
Generally mapper is opposite of dispatcher:
dispatcher: URL -> application
mapper: "application" (by name) -> URL
Read this:
http://art-blog.no-ip.info/cppcms_ref_v0_99/classcppcms_1_1url__mapper.html#_details
Unfortunately there is no url mapping tutorial yet, but the reference
documentation of this feature should be quite full.
Also take a look on message board example in the sources for use
of URL mapper.
Ask again if you have further questions after reading this.
Artyom
|