cppcms-users Mailing List for CppCMS C++ Web Framework (Page 57)
Brought to you by:
artyom-beilis
You can subscribe to this list here.
| 2009 |
Jan
|
Feb
(22) |
Mar
|
Apr
(3) |
May
|
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
(15) |
Nov
(16) |
Dec
(13) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2010 |
Jan
(4) |
Feb
|
Mar
(8) |
Apr
(8) |
May
(8) |
Jun
(36) |
Jul
(63) |
Aug
(126) |
Sep
(47) |
Oct
(66) |
Nov
(46) |
Dec
(42) |
| 2011 |
Jan
(87) |
Feb
(24) |
Mar
(54) |
Apr
(21) |
May
(22) |
Jun
(18) |
Jul
(22) |
Aug
(101) |
Sep
(57) |
Oct
(33) |
Nov
(34) |
Dec
(66) |
| 2012 |
Jan
(64) |
Feb
(76) |
Mar
(73) |
Apr
(105) |
May
(93) |
Jun
(83) |
Jul
(84) |
Aug
(88) |
Sep
(57) |
Oct
(59) |
Nov
(35) |
Dec
(49) |
| 2013 |
Jan
(67) |
Feb
(17) |
Mar
(49) |
Apr
(64) |
May
(87) |
Jun
(64) |
Jul
(93) |
Aug
(23) |
Sep
(15) |
Oct
(16) |
Nov
(62) |
Dec
(73) |
| 2014 |
Jan
(5) |
Feb
(23) |
Mar
(21) |
Apr
(11) |
May
(1) |
Jun
(19) |
Jul
(27) |
Aug
(16) |
Sep
(5) |
Oct
(37) |
Nov
(12) |
Dec
(9) |
| 2015 |
Jan
(7) |
Feb
(7) |
Mar
(44) |
Apr
(28) |
May
(5) |
Jun
(12) |
Jul
(8) |
Aug
|
Sep
(39) |
Oct
(34) |
Nov
(30) |
Dec
(34) |
| 2016 |
Jan
(66) |
Feb
(23) |
Mar
(33) |
Apr
(15) |
May
(11) |
Jun
(15) |
Jul
(26) |
Aug
(4) |
Sep
(1) |
Oct
(30) |
Nov
(10) |
Dec
|
| 2017 |
Jan
(52) |
Feb
(9) |
Mar
(24) |
Apr
(16) |
May
(9) |
Jun
(12) |
Jul
(33) |
Aug
(8) |
Sep
|
Oct
(1) |
Nov
(2) |
Dec
(6) |
| 2018 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
(14) |
Jun
(1) |
Jul
(9) |
Aug
(1) |
Sep
(13) |
Oct
(8) |
Nov
(2) |
Dec
(2) |
| 2019 |
Jan
(1) |
Feb
(1) |
Mar
(3) |
Apr
(3) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
| 2020 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(9) |
Jul
(6) |
Aug
(25) |
Sep
(10) |
Oct
(10) |
Nov
(6) |
Dec
|
| 2021 |
Jan
|
Feb
|
Mar
(7) |
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
(9) |
Oct
(1) |
Nov
|
Dec
|
| 2022 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2025 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
|
From: Troy W. <dr...@gm...> - 2013-05-08 04:00:44
|
Thank you all very much. It's now clear to me what URL mapping is and the problem it solves! On Tue, May 7, 2013 at 4:37 PM, Artyom Beilis <art...@ya...> wrote: > none of those in my code, or any other call to mapper(), yet the > application seems to work so far! > > > > > >Perhaps the problem is that I'm generating all the HTML code in CppCMS > templates and none in C++ functions. Is URL mapping relevant if I'm only > using templates to output HTML? I assume it is, because the documentation > states: > > Such system allows using "url" tag in templates system easily as" > > > > <a href="<% url "/news/article" using article id %>" >...</a> > > > > > > > >But I've been using something like: > > <a href="/news/<%= article.id %>">...</a> > > > > > >Which appears to work fine. I'm presuming there's some problem in my > usage that URL mapping solves? > > > > Now this is actually a question that is relevant... > > > I'll explain - lets see some examples > > Consider you are developing a generic application that can be installed in > different location. For example: > > www.website.com/coolnews/news/10 > www.website.com/my/news/10 > www.website.com/news/10 > > Consider you need to have some generic options in URL like language for > example > > www.website.com/my/news/ru/10 > www.website.com/my/news/en/10 > > Now your URL generation becomes > > > <a href="<%= root_url %>/news/<%= lang %>/<%= article.id %>" > ...</a> > > More than that, consider you have URL like > > /wiki/this%20my%20title > > i.e. you have native text than it should be > > <a href="<%= root_url %>/news/<%= lang %>/<%= article.id | urlencode > %>" > ...</a> > > Now put it in every possible corner - not easy. > > So, this what url mapping you solves - it provide easy, generic and > abstract way to generate URLs such that > > 1. You can change them easily and actual URL format is located in one > place not all over the code > 2. You can manipulate various different properties globally (locale/root > etc) > 3. The default filter is URL encode and not HTML escape that suites URL > generation much better. > > > > > In my first applications I used the approach you had started with but it > becomes much harder > to maintain - that is why url mapper was developed. > > > Artyom Beilis > -------------- > CppCMS - C++ Web Framework: http://cppcms.com/ > CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ > > > ------------------------------------------------------------------------------ > Learn Graph Databases - Download FREE O'Reilly Book > "Graph Databases" is the definitive new guide to graph databases and > their applications. This 200-page book is written by three acclaimed > leaders in the field. The early access version is available now. > Download your free book today! http://p.sf.net/sfu/neotech_d2d_may > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |
|
From: Artyom B. <art...@ya...> - 2013-05-07 06:37:41
|
none of those in my code, or any other call to mapper(), yet the application seems to work so far! > > >Perhaps the problem is that I'm generating all the HTML code in CppCMS templates and none in C++ functions. Is URL mapping relevant if I'm only using templates to output HTML? I assume it is, because the documentation states: > Such system allows using "url" tag in templates system easily as" > > <a href="<% url "/news/article" using article id %>" >...</a> > > > >But I've been using something like: > <a href="/news/<%= article.id %>">...</a> > > >Which appears to work fine. I'm presuming there's some problem in my usage that URL mapping solves? > Now this is actually a question that is relevant... I'll explain - lets see some examples Consider you are developing a generic application that can be installed in different location. For example: www.website.com/coolnews/news/10 www.website.com/my/news/10 www.website.com/news/10 Consider you need to have some generic options in URL like language for example www.website.com/my/news/ru/10 www.website.com/my/news/en/10 Now your URL generation becomes <a href="<%= root_url %>/news/<%= lang %>/<%= article.id %>" > ...</a> More than that, consider you have URL like /wiki/this%20my%20title i.e. you have native text than it should be <a href="<%= root_url %>/news/<%= lang %>/<%= article.id | urlencode %>" > ...</a> Now put it in every possible corner - not easy. So, this what url mapping you solves - it provide easy, generic and abstract way to generate URLs such that 1. You can change them easily and actual URL format is located in one place not all over the code 2. You can manipulate various different properties globally (locale/root etc) 3. The default filter is URL encode and not HTML escape that suites URL generation much better. In my first applications I used the approach you had started with but it becomes much harder to maintain - that is why url mapper was developed. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ |
|
From: Lee E. <lee...@gm...> - 2013-05-07 06:13:26
|
I'll give a broader response:
web apps use HTTP protocol. This protocol is essentially stateless
so a client (browser) issue a request to the server (GET or POST are the
most common) with a url - now the server needs to resolve the URL in order
to find what code to run - this is dispatching
the code dispached generate a response (usually an HTML content) and that
content is sent over to the browser that renderes it.
with that a complete cycle is complete and the connection between the
server and the client is severed and they go their separate ways.
If only life where so simple :)
We usually do not write web application that only render data from URL - we
ususally have web pages that interact with one another. So if i want in the
page my code generated to provide a button for example that activates a
specific functionality in my app - i need to generate proper URL for that
button that will be dispatched to the correct code. So instead
of figuring by hand what that URL is, i can assign that piece of code a key
whe i register it with the dispatcher - and ask to get the url that match
that key - this is mapping
I hope this helps
On Fri, May 3, 2013 at 1:35 PM, Petr Janda <ele...@ex...>wrote:
> One way to use the url_mapper class is when using
> http_response::set_redirect_header() function.
>
> In combination with the url() function you can easily translate a single
> name/key to a longer url.
>
> Such as: set_response_header(url("my_key", "argument"))
>
> Which depending on the value mapped to my_key might get translated to
> something like "/some/url/with/'argument'"
>
>
>
> On 3/05/2013 6:40 PM, Troy Watson wrote:
> > <digression>
> > > 1. Read the docs.
> > I have read both the tutorials online and the API documentation
> generated
> > by Doxygen. The documentation is riddled with spelling
> > and grammatical errors making it difficult for me to comprehend in some
> > places.
> >
> > > 2. Read existing code and examples.
> > You must have missed earlier where I mentioned reading the examples and
> > looking through the code and not understanding the concept or use of the
> > url_mapper class! That's why I'm here asking people who do understand it,
> > hoping they can share some knowledge! The help so far is VERY
> appreciated.
> > :)
> >
> > > It is a walk in park if you already know C++...
> > I do.
> >
> > > ... and some basic web programming.
> > I don't. The documentation fails to educate a person new to web
> > development, like me.
> > </digression>
> >
> > Anyway, back on topic:
> > I think I'm not understanding HOW to use the url_mapper class because I
> > don't understand WHY I would need to or should. What problem does it
> solve?
> > Like I said above, I'm new to web programming. In a project larger than
> > CppBlog and WikiPP I'm not using the URL mapping functions anywhere,
> which
> > leads me to believe that either it's useless or, more likely, I'm doing
> > something wrong! :)
> >
> > According to a simple "grep -R mapper()", the url_mapper member of the
> > application class is referred to 52 times in all the examples code and
> > WikiPP and CppBlog code. Of those 52 uses, only seven are not a call to
> > mapper().assign(...). Five are to mapper().root(...) and the remaining
> two
> > are for mapper().set_value(...). I use none of those in my code, or any
> > other call to mapper(), yet the application seems to work so far!
> >
> > Perhaps the problem is that I'm generating all the HTML code in CppCMS
> > templates and none in C++ functions. Is URL mapping relevant if I'm only
> > using templates to output HTML? I assume it is, because the documentation
> > states:
> > Such system allows using "url" tag in templates system easily as"
> > <a href="<% url "/news/article" using article id %>" >...</a>
> >
> > But I've been using something like:
> > <a href="/news/<%= article.id %>">...</a>
> >
> > Which appears to work fine. I'm presuming there's some problem in my
> usage
> > that URL mapping solves?
> >
> > Thank you all for being patient with me and helping where you can!
> >
> >
> > On Fri, May 3, 2013 at 1:36 AM, Shiv Shankar Dayal <
> > shi...@gm...> wrote:
> >
> >> Two things. 1. Read the docs. 2. Read existing code and examples. It is
> a
> >> walk in park if you already know C++ and some basic web programming.
> >>
> >>
> >> On Thu, May 2, 2013 at 9:04 PM, Shiv Shankar Dayal <
> >> shi...@gm...> wrote:
> >>
> >>> look up examples directory in cppcms directory. you need cppdb for some
> >>> apps. you can also install cppwiki and cppblog for more understanding.
> It
> >>> is all there for you.
> >>>
> >>>
> >>> On Thu, May 2, 2013 at 1:08 PM, Troy Watson <dr...@gm...> wrote:
> >>>
> >>>> 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
> >>>>
> >>>>
> >>>
> >>>
> >>> --
> >>> Best regards,
> >>> Shiv Shankar Dayal
> >>>
> >>
> >>
> >>
> >> --
> >> 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
> >>
> >>
> >
> >
> >
> >
> ------------------------------------------------------------------------------
> > Get 100% visibility into Java/.NET code with AppDynamics Lite
> > It's a free troubleshooting tool designed for production
> > Get down to code-level detail for bottlenecks, with <2% overhead.
> > Download for free and get started troubleshooting in minutes.
> > http://p.sf.net/sfu/appdyn_d2d_ap2
> >
> >
> >
> > _______________________________________________
> > Cppcms-users mailing list
> > Cpp...@li...
> > https://lists.sourceforge.net/lists/listinfo/cppcms-users
> >
>
>
> --
> Please use PGP to encrypt your email to ensure our privacy is respected.
>
>
>
> ------------------------------------------------------------------------------
> Get 100% visibility into Java/.NET code with AppDynamics Lite
> It's a free troubleshooting tool designed for production
> Get down to code-level detail for bottlenecks, with <2% overhead.
> Download for free and get started troubleshooting in minutes.
> http://p.sf.net/sfu/appdyn_d2d_ap2
> _______________________________________________
> Cppcms-users mailing list
> Cpp...@li...
> https://lists.sourceforge.net/lists/listinfo/cppcms-users
>
>
--
--
lee
Lee Elenbaas
lee...@gm...
|
|
From: Artyom B. <art...@ya...> - 2013-05-05 06:47:04
|
I had seen this benchmarks "game" Two points: 1. It has nothing to do with real programming and measures very small factors - when we measure a real application the difference become more significant 2. I had no time to prepare the benchmark. If someone willing to write a benchmark I'll gladly review the code to make sure it works as fast as possible. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >________________________________ > From: Alessandro Stamatto <ast...@gm...> >To: cpp...@li... >Sent: Friday, May 3, 2013 8:36 PM >Subject: [Cppcms-users] Is someone interested in CppCms participating on this Web Framework benchmark? > > > >Some Java Programmers (from TechEmpower) are doing some Web Framework Benchmarks, > >Right now they're on the 4 round, > > >Reddit discussion: http://www.reddit.com/r/programming/comments/1dk2am/web_framework_benchmarks_round_4/ >BlogPost: >http://www.techempower.com/blog/2013/05/02/frameworks-round-4/ >Results: >http://www.techempower.com/benchmarks/#section=data-r4 > >There's no C++ Web Framework yet, and the author told me it was because he was not confident on writing a fair C++ entry due to inexperience in the language: > >"Just so it's out there, we (I am a senior programmer at TechEmpower) did not choose to not include any C++ web frameworks; we are a primarily Java shop and so no one was really comfortable with the idea of writing a test for one of the C++ frameworks we saw because we are not experts with the language. Personally, I would never sign my name next to a C++ app I wrote that was going to be public facing; I'm just not confident enough with the language to know, like I do with Java, that I was getting it right. >All that being said, anyone is welcome to issue a pull request with a new language/framework test and (provided it meets all the requirements of the tests) we will add it to the next round of benchmarks." > >I'm also very inexperienced in both C++ and CppCMS (but I love both ; ] ), as such I'm not qualified implementing the test case. > >The author of Wt might implement the test case for the next Benchmark iteration: > >"Wt author here, we would like to see Wt included; it would only be benchmarking 0.1% of it (nothing related to its widgets or rendering) but still it would give us some insight in how our http server, ORM and template engine is doing. We'll try to implement the test cases, if you are willing to include them?" > >I'm sending this shootout because it would be great to see CppCMS on the benchmark! > >------------------------------------------------------------------------------ >Get 100% visibility into Java/.NET code with AppDynamics Lite >It's a free troubleshooting tool designed for production >Get down to code-level detail for bottlenecks, with <2% overhead. >Download for free and get started troubleshooting in minutes. >http://p.sf.net/sfu/appdyn_d2d_ap2 >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |
|
From: Sergey <ser...@gm...> - 2013-05-05 05:12:03
|
http://cppcms.com/wikipp/en/page/benchmarks_all p.s: 1-2 years ago I was looking at Wt (C + +) and mongoose (C). But then I found cppcms and he was in my opinion much better and easier. cppcms (v> 1.x) is very easy to learn. Write as large and small projects it easy, at least easier than Wt. The author is smart and friendly. He is always ready to help in any matter. For me cppcms it is a matter of taste. |
|
From: Alessandro S. <ast...@gm...> - 2013-05-03 17:36:45
|
Some Java Programmers (from TechEmpower) are doing some Web Framework Benchmarks, Right now they're on the 4 round, Reddit discussion: http://www.reddit.com/r/programming/comments/1dk2am/web_framework_benchmarks_round_4/ BlogPost: http://www.techempower.com/blog/2013/05/02/frameworks-round-4/ Results: http://www.techempower.com/benchmarks/#section=data-r4 There's no C++ Web Framework yet, and the author told me it was because he was not confident on writing a fair C++ entry due to inexperience in the language: "Just so it's out there, we (I am a senior programmer at TechEmpower) did not *choose* to not include any C++ web frameworks; we are a primarily Java shop and so no one was really comfortable with the idea of writing a test for one of the C++ frameworks we saw because we are not experts with the language. Personally, I would never sign my name next to a C++ app I wrote that was going to be public facing; I'm just not confident enough with the language to know, like I do with Java, that I was getting it right. All that being said, *anyone* is welcome to issue a pull request with a new language/framework test and (provided it meets all the requirements of the tests) we will add it to the next round of benchmarks." I'm also very inexperienced in both C++ and CppCMS (but I love both ; ] ), as such I'm not qualified implementing the test case. The author of Wt might implement the test case for the next Benchmark iteration: "Wt author here, we would like to see Wt included; it would only be benchmarking 0.1% of it (nothing related to its widgets or rendering) but still it would give us some insight in how our http server, ORM and template engine is doing. We'll try to implement the test cases, if you are willing to include them?" I'm sending this shootout because it would be great to see CppCMS on the benchmark! |
|
From: Petr J. <ele...@ex...> - 2013-05-03 10:36:11
|
One way to use the url_mapper class is when using
http_response::set_redirect_header() function.
In combination with the url() function you can easily translate a single
name/key to a longer url.
Such as: set_response_header(url("my_key", "argument"))
Which depending on the value mapped to my_key might get translated to
something like "/some/url/with/'argument'"
On 3/05/2013 6:40 PM, Troy Watson wrote:
> <digression>
> > 1. Read the docs.
> I have read both the tutorials online and the API documentation generated
> by Doxygen. The documentation is riddled with spelling
> and grammatical errors making it difficult for me to comprehend in some
> places.
>
> > 2. Read existing code and examples.
> You must have missed earlier where I mentioned reading the examples and
> looking through the code and not understanding the concept or use of the
> url_mapper class! That's why I'm here asking people who do understand it,
> hoping they can share some knowledge! The help so far is VERY appreciated.
> :)
>
> > It is a walk in park if you already know C++...
> I do.
>
> > ... and some basic web programming.
> I don't. The documentation fails to educate a person new to web
> development, like me.
> </digression>
>
> Anyway, back on topic:
> I think I'm not understanding HOW to use the url_mapper class because I
> don't understand WHY I would need to or should. What problem does it solve?
> Like I said above, I'm new to web programming. In a project larger than
> CppBlog and WikiPP I'm not using the URL mapping functions anywhere, which
> leads me to believe that either it's useless or, more likely, I'm doing
> something wrong! :)
>
> According to a simple "grep -R mapper()", the url_mapper member of the
> application class is referred to 52 times in all the examples code and
> WikiPP and CppBlog code. Of those 52 uses, only seven are not a call to
> mapper().assign(...). Five are to mapper().root(...) and the remaining two
> are for mapper().set_value(...). I use none of those in my code, or any
> other call to mapper(), yet the application seems to work so far!
>
> Perhaps the problem is that I'm generating all the HTML code in CppCMS
> templates and none in C++ functions. Is URL mapping relevant if I'm only
> using templates to output HTML? I assume it is, because the documentation
> states:
> Such system allows using "url" tag in templates system easily as"
> <a href="<% url "/news/article" using article id %>" >...</a>
>
> But I've been using something like:
> <a href="/news/<%= article.id %>">...</a>
>
> Which appears to work fine. I'm presuming there's some problem in my usage
> that URL mapping solves?
>
> Thank you all for being patient with me and helping where you can!
>
>
> On Fri, May 3, 2013 at 1:36 AM, Shiv Shankar Dayal <
> shi...@gm...> wrote:
>
>> Two things. 1. Read the docs. 2. Read existing code and examples. It is a
>> walk in park if you already know C++ and some basic web programming.
>>
>>
>> On Thu, May 2, 2013 at 9:04 PM, Shiv Shankar Dayal <
>> shi...@gm...> wrote:
>>
>>> look up examples directory in cppcms directory. you need cppdb for some
>>> apps. you can also install cppwiki and cppblog for more understanding. It
>>> is all there for you.
>>>
>>>
>>> On Thu, May 2, 2013 at 1:08 PM, Troy Watson <dr...@gm...> wrote:
>>>
>>>> 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
>>>>
>>>>
>>>
>>>
>>> --
>>> Best regards,
>>> Shiv Shankar Dayal
>>>
>>
>>
>>
>> --
>> 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
>>
>>
>
>
>
> ------------------------------------------------------------------------------
> Get 100% visibility into Java/.NET code with AppDynamics Lite
> It's a free troubleshooting tool designed for production
> Get down to code-level detail for bottlenecks, with <2% overhead.
> Download for free and get started troubleshooting in minutes.
> http://p.sf.net/sfu/appdyn_d2d_ap2
>
>
>
> _______________________________________________
> Cppcms-users mailing list
> Cpp...@li...
> https://lists.sourceforge.net/lists/listinfo/cppcms-users
>
--
Please use PGP to encrypt your email to ensure our privacy is respected.
|
|
From: Saikumar G. <sai...@gm...> - 2013-05-03 10:31:13
|
Max-Age did not work in IE 8.0 with which I tested.
Artyom,
Unless I am mistaken, the session implementation in cppcms relies on Max-Age to expire and
delete it. If so how did you accomplish it to work on IE versions of browser ?
|
|
From: Saikumar G. <sai...@gm...> - 2013-05-03 10:17:54
|
I got this working. Cookie was removed on setting the max age to 0 on Chrome, FF and Safari. Havent tested this on IE yet. The issue is that the path was different from the page it was initially set to the page it was deleting. Setting the path to / in both places solved this. |
|
From: Troy W. <dr...@gm...> - 2013-05-03 08:40:29
|
<digression>
> 1. Read the docs.
I have read both the tutorials online and the API documentation generated
by Doxygen. The documentation is riddled with spelling
and grammatical errors making it difficult for me to comprehend in some
places.
> 2. Read existing code and examples.
You must have missed earlier where I mentioned reading the examples and
looking through the code and not understanding the concept or use of the
url_mapper class! That's why I'm here asking people who do understand it,
hoping they can share some knowledge! The help so far is VERY appreciated.
:)
> It is a walk in park if you already know C++...
I do.
> ... and some basic web programming.
I don't. The documentation fails to educate a person new to web
development, like me.
</digression>
Anyway, back on topic:
I think I'm not understanding HOW to use the url_mapper class because I
don't understand WHY I would need to or should. What problem does it solve?
Like I said above, I'm new to web programming. In a project larger than
CppBlog and WikiPP I'm not using the URL mapping functions anywhere, which
leads me to believe that either it's useless or, more likely, I'm doing
something wrong! :)
According to a simple "grep -R mapper()", the url_mapper member of the
application class is referred to 52 times in all the examples code and
WikiPP and CppBlog code. Of those 52 uses, only seven are not a call to
mapper().assign(...). Five are to mapper().root(...) and the remaining two
are for mapper().set_value(...). I use none of those in my code, or any
other call to mapper(), yet the application seems to work so far!
Perhaps the problem is that I'm generating all the HTML code in CppCMS
templates and none in C++ functions. Is URL mapping relevant if I'm only
using templates to output HTML? I assume it is, because the documentation
states:
Such system allows using "url" tag in templates system easily as"
<a href="<% url "/news/article" using article id %>" >...</a>
But I've been using something like:
<a href="/news/<%= article.id %>">...</a>
Which appears to work fine. I'm presuming there's some problem in my usage
that URL mapping solves?
Thank you all for being patient with me and helping where you can!
On Fri, May 3, 2013 at 1:36 AM, Shiv Shankar Dayal <
shi...@gm...> wrote:
> Two things. 1. Read the docs. 2. Read existing code and examples. It is a
> walk in park if you already know C++ and some basic web programming.
>
>
> On Thu, May 2, 2013 at 9:04 PM, Shiv Shankar Dayal <
> shi...@gm...> wrote:
>
>> look up examples directory in cppcms directory. you need cppdb for some
>> apps. you can also install cppwiki and cppblog for more understanding. It
>> is all there for you.
>>
>>
>> On Thu, May 2, 2013 at 1:08 PM, Troy Watson <dr...@gm...> wrote:
>>
>>> 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
>>>
>>>
>>
>>
>> --
>> Best regards,
>> Shiv Shankar Dayal
>>
>
>
>
> --
> 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
>
>
|
|
From: Petr J. <ele...@ex...> - 2013-05-03 08:18:22
|
Yeah I've seen that. Here is what I'd need to do: Async app sends a handler to threadpool to execute a heavy processing task via threadpool::post. Ok Suppose the heavy processing task wants to print out a status ie. "Task 1 processed, Task 2 processed etc" and want to send it back the the Async app that move the processing to the thread pool so that they can be displayed on a webpage via a long-polling request. Is service::post() used for this? If there was multiple async apps, how to designate the one that should receive these messages? What am I missing? On 3/05/2013 5:55 PM, Artyom Beilis wrote: > > >> ________________________________ >> From: Petr Janda <ele...@ex...> >> To: cpp...@li... >> Sent: Friday, May 3, 2013 6:28 AM >> Subject: Re: [Cppcms-users] Heavy background processing >> >> >> Reading the "thread safety" page, it suggests >> >> "If asynchronous application or any other object that runs in the event >> wants to execute some long running, blocking or heavy operation, it may >> do it by submitting an execution handler to the thread pool." >> >> How is such handler created and submitted to the thread pool? > > http://cppcms.com/cppcms_ref/1.0.0/classcppcms_1_1service.html#a9f52695695783504530983d5d76f44e7 > > http://cppcms.com/cppcms_ref/latest/classcppcms_1_1thread__pool.html > > > > > > > Artyom Beilis > -------------- > CppCMS - C++ Web Framework: http://cppcms.com/ > CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ > > ------------------------------------------------------------------------------ > Get 100% visibility into Java/.NET code with AppDynamics Lite > It's a free troubleshooting tool designed for production > Get down to code-level detail for bottlenecks, with <2% overhead. > Download for free and get started troubleshooting in minutes. > http://p.sf.net/sfu/appdyn_d2d_ap2 > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > -- Please use PGP to encrypt your email to ensure our privacy is respected. |
|
From: Artyom B. <art...@ya...> - 2013-05-03 07:55:10
|
>________________________________ > From: Petr Janda <ele...@ex...> >To: cpp...@li... >Sent: Friday, May 3, 2013 6:28 AM >Subject: Re: [Cppcms-users] Heavy background processing > > >Reading the "thread safety" page, it suggests > >"If asynchronous application or any other object that runs in the event >wants to execute some long running, blocking or heavy operation, it may >do it by submitting an execution handler to the thread pool." > >How is such handler created and submitted to the thread pool? http://cppcms.com/cppcms_ref/1.0.0/classcppcms_1_1service.html#a9f52695695783504530983d5d76f44e7 http://cppcms.com/cppcms_ref/latest/classcppcms_1_1thread__pool.html Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ |
|
From: Petr J. <ele...@ex...> - 2013-05-03 03:28:11
|
Reading the "thread safety" page, it suggests "If asynchronous application or any other object that runs in the event wants to execute some long running, blocking or heavy operation, it may do it by submitting an execution handler to the thread pool." How is such handler created and submitted to the thread pool? On 3/05/2013 1:22 PM, Petr Janda wrote: > Hi, > > I need to run a background process that does some heavy work, and needs > to run asynchronously (from the moment main() is executed until it's > stopped). > > So i've been reading about asynchronous applications(the chat example) > but I read a thread on this mailing list suggesting that heavy > processing applications shouldn't be run in the main event loop > asynchronously. > > I'm also going to need to long-poll the background app because it will > print details to a page about it's status. > > How should such background processing be run? > > Thanks, > Petr > > > > ------------------------------------------------------------------------------ > Get 100% visibility into Java/.NET code with AppDynamics Lite > It's a free troubleshooting tool designed for production > Get down to code-level detail for bottlenecks, with <2% overhead. > Download for free and get started troubleshooting in minutes. > http://p.sf.net/sfu/appdyn_d2d_ap2 > > > > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > -- Please use PGP to encrypt your email to ensure our privacy is respected. |
|
From: Petr J. <ele...@ex...> - 2013-05-03 03:22:14
|
Hi, I need to run a background process that does some heavy work, and needs to run asynchronously (from the moment main() is executed until it's stopped). So i've been reading about asynchronous applications(the chat example) but I read a thread on this mailing list suggesting that heavy processing applications shouldn't be run in the main event loop asynchronously. I'm also going to need to long-poll the background app because it will print details to a page about it's status. How should such background processing be run? Thanks, Petr -- Please use PGP to encrypt your email to ensure our privacy is respected. |
|
From: Petr J. <ele...@ex...> - 2013-05-03 03:14:02
|
I don't think setting max_age to 0 is actually meant to remove the cookie.
On 2/05/2013 2:09 PM, Saikumar Gandapodi wrote:
> Yet another issue I am facing when using cookie.
>
> I would like to store a user key in cookie when the user logs in and remove the
> cookie when the user logs out.
>
> After successful login the cookie is set
> app.response().set_cookie(cppcms::http::cookie("_key_", key));
>
> and during logout the cookie is set with max age 0
> cppcms::http::cookie thecookie("_key_", key);
> thecookie.max_age(0);
> app,response().set_cookie(thecookie);
>
> However the cookie is never removed from the browser after logout happens.
> Any ideas why this is happening.
>
> Also, I see that cppcms is using Max-Age to set the cookie expiry.
> How will this work for earlier IE versions ?
>
>
>
>
> ------------------------------------------------------------------------------
> 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
>
--
Please use PGP to encrypt your email to ensure our privacy is respected.
|
|
From: Shiv S. D. <shi...@gm...> - 2013-05-02 15:36:14
|
Two things. 1. Read the docs. 2. Read existing code and examples. It is a walk in park if you already know C++ and some basic web programming. On Thu, May 2, 2013 at 9:04 PM, Shiv Shankar Dayal < shi...@gm...> wrote: > look up examples directory in cppcms directory. you need cppdb for some > apps. you can also install cppwiki and cppblog for more understanding. It > is all there for you. > > > On Thu, May 2, 2013 at 1:08 PM, Troy Watson <dr...@gm...> wrote: > >> 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 >> >> > > > -- > Best regards, > Shiv Shankar Dayal > -- Best regards, Shiv Shankar Dayal |
|
From: Shiv S. D. <shi...@gm...> - 2013-05-02 15:34:57
|
look up examples directory in cppcms directory. you need cppdb for some apps. you can also install cppwiki and cppblog for more understanding. It is all there for you. On Thu, May 2, 2013 at 1:08 PM, Troy Watson <dr...@gm...> wrote: > 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 > > -- Best regards, Shiv Shankar Dayal |
|
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 > |
|
From: Troy W. <dr...@gm...> - 2013-05-02 07:38:51
|
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 > > |
|
From: Artyom B. <art...@ya...> - 2013-05-02 04:46:28
|
Don't reinvent the wheel - use sessions: http://cppcms.com/wikipp/en/page/cppcms_1x_sessions http://cppcms.com/wikipp/en/page/secure_programming Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >________________________________ > From: Saikumar Gandapodi <sai...@gm...> >To: cpp...@li... >Sent: Thursday, May 2, 2013 7:09 AM >Subject: Re: [Cppcms-users] Cookies > > >Yet another issue I am facing when using cookie. > >I would like to store a user key in cookie when the user logs in and remove the >cookie when the user logs out. > >After successful login the cookie is set > app.response().set_cookie(cppcms::http::cookie("_key_", key)); > >and during logout the cookie is set with max age 0 > cppcms::http::cookie thecookie("_key_", key); > thecookie.max_age(0); > app,response().set_cookie(thecookie); > >However the cookie is never removed from the browser after logout happens. >Any ideas why this is happening. > >Also, I see that cppcms is using Max-Age to set the cookie expiry. >How will this work for earlier IE versions ? > > > > >------------------------------------------------------------------------------ >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 > > > |
|
From: Saikumar G. <sai...@gm...> - 2013-05-02 04:10:01
|
Yet another issue I am facing when using cookie.
I would like to store a user key in cookie when the user logs in and remove the
cookie when the user logs out.
After successful login the cookie is set
app.response().set_cookie(cppcms::http::cookie("_key_", key));
and during logout the cookie is set with max age 0
cppcms::http::cookie thecookie("_key_", key);
thecookie.max_age(0);
app,response().set_cookie(thecookie);
However the cookie is never removed from the browser after logout happens.
Any ideas why this is happening.
Also, I see that cppcms is using Max-Age to set the cookie expiry.
How will this work for earlier IE versions ?
|
|
From: Shiv S. D. <shi...@gm...> - 2013-04-30 15:03:50
|
Or you can say make -j<no of cpu cores>|less if you want faster compilation and do not want a file. On Sun, Apr 28, 2013 at 5:17 PM, Artyom Beilis <art...@ya...> wrote: > make &>log.txt > > :-) > > Artyom Beilis > -------------- > CppCMS - C++ Web Framework: http://cppcms.com/ > CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ > > ------------------------------ > *From:* Troy Watson <dr...@gm...> > *To:* Artyom Beilis <art...@ya...>; > cpp...@li... > *Sent:* Sunday, April 28, 2013 12:32 PM > *Subject:* Re: [Cppcms-users] URL dispatching help > > 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 > > > > > ------------------------------------------------------------------------------ > 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 |
|
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 |
|
From: Shiv S. D. <shi...@gm...> - 2013-04-30 14:59:58
|
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 |
|
From: Troy W. <dr...@gm...> - 2013-04-30 08:46:26
|
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 > |