Re: [Cppcms-users] URL dispatching help
Brought to you by:
artyom-beilis
|
From: Shiv S. D. <shi...@gm...> - 2013-04-30 15:01:56
|
If you are on Linux you can set buffer to unlimited on Gnome-Terminal or Konsole. On Sun, Apr 28, 2013 at 3:02 PM, Troy Watson <dr...@gm...> wrote: > Thanks for the help. I used the code from your reply, but it causes dozens > of template errors - so many that the terminal's output buffer overflows > and I can't scroll all the way up to where they begin! > > > On Sun, Apr 28, 2013 at 7:13 PM, Artyom Beilis <art...@ya...>wrote: > >> >> If you need two parameters i.e. go(std::string id,std::string urd) that >> you need provide sleections for both, i.e. >> dispatcher().assign( "/go/(\\d+)(.*)", &application::go, this, 1, 2 ); >> >> Where 1 - is first selected subexpression and 2 is the second one. >> >> Also I'm not sure but it seems that you need go(std::string >> id,std::string url) without const. >> >> Artyom Beilis >> -------------- >> CppCMS - C++ Web Framework: http://cppcms.com/ >> CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >> >> ------------------------------ >> *From:* Troy Watson <dr...@gm...> >> *To:* cpp...@li... >> *Sent:* Sunday, April 28, 2013 12:04 PM >> *Subject:* [Cppcms-users] URL dispatching help >> >> Despite reading the docs and looking at the examples, I can't figure out >> complex dispatching/mapping with regexes. I need some help please! >> >> My callback member function looks like this: void go( const std::string >> id, const std::string url ) { ... } >> And the URL to map to the function looks like this: /go/{integer >> id}/{string url} >> >> For example: >> /go/10/http://google.com - id=10, url=http://google.com >> /go/2921/http://sourceforge.net - id=2921, url=http://sourceforge.net >> >> The best I could come up with was this: >> >> dispatcher().assign( "/go/(\\d+)(.*)", &application::go, this, 2 ); >> mapper().assign( "go", "/go/{1}/{2}" ); >> >> ...but obviously that doesn't compile. What should the dispatcher and >> mapper call look like to get the functionality I'm looking for? >> >> Thank you for such an excellent framework! >> >> >> ------------------------------------------------------------------------------ >> 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 >> >> >> >> >> ------------------------------------------------------------------------------ >> 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 >> >> > > > ------------------------------------------------------------------------------ > 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 > > -- Best regards, Shiv Shankar Dayal |