Re: [Cppcms-users] URL dispatching help
Brought to you by:
artyom-beilis
|
From: <ele...@ex...> - 2013-05-02 08:30:03
|
it's simple dispatcher = URL to function mapper = key to URL look at the url_mapper::assign function and read the url_mapper class doc entirely. http://cppcms.com/cppcms_ref/1.0.0/classcppcms_1_1url__mapper.html you designate a "key" to a particular page, and when you call that "key" within your code, it's translated to an URL. Say you name a key "edit", and map it to /edit/{1}. Petr > Nope - still not getting it :( > > Perhaps if you can spare some time to show me with a real, practical > example I'll understand. > > I have the following line in my code: dispatcher().assign( "/edit/(\\d+)", > &application::edit_bookmark, this, 1 ); > It correctly calls this function: > > void edit_bookmarks( std::string id ) > > ...when I click links that look like /edit/10 or /edit/9239 etc. > Dispatching I understand. > > Where does mapping come into this? How can my application be improved with > a call to mapper(...)? How could it compliment the dispatcher as shown > above? > > > > > On Wed, May 1, 2013 at 12:59 AM, Shiv Shankar Dayal < > shi...@gm...> wrote: > >> It is simple actually. You click a link some function on server is >> invoked >> and output is displayed on another link. One is mapping another is >> dispatching. >> >> >> Best regards, >> Shiv >> >> >> On Tue, Apr 30, 2013 at 2:16 PM, Troy Watson <dr...@gm...> wrote: >> >>> I've read that page several times, messed about with the url_mapping >>> example, and it still makes no sense to me what you mean by "the >>> opposite >>> of dispatching". I appreciate the help, but please explain it like I've >>> never written a webapp before... because I haven't! >>> >>> >>> On Mon, Apr 29, 2013 at 4:28 PM, Artyom Beilis >>> <art...@ya...>wrote: >>> >>>> > What is mapper().assign( "...", "..." ) used for? All my URL >>>> dispatching seems to work by only calling >>>> > dispatcher().assign(...) to set up the URLs with a callback >>>> function. >>>> > What concept am I not understanding that would require the mapper()? >>>> >>>> The opposite of dispatching :-) >>>> >>>> >>>> See: http://cppcms.com/wikipp/en/page/cppcms_1x_tut_url_mapping >>>> >>>> >>>> >>>> Artyom Beilis >>>> -------------- >>>> CppCMS - C++ Web Framework: http://cppcms.com/ >>>> CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> Try New Relic Now & We'll Send You this Cool Shirt >>>> New Relic is the only SaaS-based application performance monitoring >>>> service >>>> that delivers powerful full stack analytics. Optimize and monitor your >>>> browser, app, & servers with just a few lines of code. Try New Relic >>>> and get this awesome Nerd Life shirt! >>>> http://p.sf.net/sfu/newrelic_d2d_apr >>>> _______________________________________________ >>>> Cppcms-users mailing list >>>> Cpp...@li... >>>> https://lists.sourceforge.net/lists/listinfo/cppcms-users >>>> >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET >>> Get 100% visibility into your production application - at no cost. >>> Code-level diagnostics for performance bottlenecks with <2% overhead >>> Download for free and get started troubleshooting in minutes. >>> http://p.sf.net/sfu/appdyn_d2d_ap1 >>> >>> _______________________________________________ >>> Cppcms-users mailing list >>> Cpp...@li... >>> https://lists.sourceforge.net/lists/listinfo/cppcms-users >>> >>> >> >> >> -- >> Best regards, >> Shiv Shankar Dayal >> >> >> ------------------------------------------------------------------------------ >> Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET >> Get 100% visibility into your production application - at no cost. >> Code-level diagnostics for performance bottlenecks with <2% overhead >> Download for free and get started troubleshooting in minutes. >> http://p.sf.net/sfu/appdyn_d2d_ap1 >> _______________________________________________ >> Cppcms-users mailing list >> Cpp...@li... >> https://lists.sourceforge.net/lists/listinfo/cppcms-users >> >> > ------------------------------------------------------------------------------ > Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET > Get 100% visibility into your production application - at no cost. > Code-level diagnostics for performance bottlenecks with <2% overhead > Download for free and get started troubleshooting in minutes. > http://p.sf.net/sfu/appdyn_d2d_ap1_______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |