cppcms-users Mailing List for CppCMS C++ Web Framework (Page 131)
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
|
From: augustin <aug...@ov...> - 2010-08-25 11:09:11
|
On Wednesday 25 August 2010 06:29:35 pm Julian Pietron wrote: > Hi, > > how can I get a certain header sent with the client's request? I was > looking for a method like std::string request().header("which-header");, > but didn't find a method like this. > Could one please point me to the method I can use to get a http header? > The problem is, that it's a custom header, so the methods from > http::request for standard headers won't suffice. Hi Julian, Won't this fit your needs? void cppcms::http::response::set_header ( std::string const & name, std::string const & value ) <http://art-blog.no- ip.info/cppcms_ref_v0_99/classcppcms_1_1http_1_1response.html#37b0c6c284c9d8f319a87c86d182f021> I am not yet familiar which forms can headers take, but I just came across this, so I thought I'd mention it. Augustin. -- Friends: http://www.reuniting.info/ http://activistsolutions.org/ My projects: http://astralcity.org/ http://3enjeux.overshoot.tv/ http://linux.overshoot.tv/ http://overshoot.tv/ http://charityware.info/ http://masquilier.org/ http://openteacher.info/ http://minguo.info/ http://www.wechange.org/ http://searching911.info/ . |
From: Julian P. <ju...@wh...> - 2010-08-25 10:29:45
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, how can I get a certain header sent with the client's request? I was looking for a method like std::string request().header("which-header");, but didn't find a method like this. Could one please point me to the method I can use to get a http header? The problem is, that it's a custom header, so the methods from http::request for standard headers won't suffice. Thanks, Julian -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.15 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQIcBAEBAgAGBQJMdPCPAAoJENidYKvYQHlQBvwQAK+eWPqeP/bayq8oNQ9Wg1+F wSLEBDQNBCbxQaYSVuy/b5eRluRMajlTO01YUtTB3FONPXUnemx9H3qQLE4WRO3w s8JyQVjys5yNJxKp8N2KeuhW6+x3RMyZugyK7KUdN2jJKpW1KZE3I5vdAFOqZkPl TthVw1Xt91FhU72K21muP+N4zFPScev01q90BuFvnl2WkTqqNTAYV/8Eh4cZMlVo 9ujVEP7WKagA4rw2M3DcTKTCDuMJzxu6k/QhYCTZ3eZOMplo2GztXkcODT40HFnn ZPRnCQRT9NRgNlj9I0EZ3Re7UONbXvvDNSBs/1xYQApqB3/SoWIayqRebi+wox+n eIhiwuUS1TgPMoGV5/rqQqqzYdS6HOaakirD1hTJHehKwRY8lvKz4xWSH393cZME 4sLjYAKC/i3Bi+F+Bzj5JacnMHfYMFJicz2GlkslEjBeogdOFD6eakEtQ0/2UCFM DDywIdx3Ppf7f+nd6FXpVzSK1b4T7VEuQ65zjv+4jg0cNGpYznv+D1kdYs376vby w55pfTyatLwXQtN7GhQN1R+obnx/tSjdbO/sGYKc8erNEqZB7gwrCa+vTL4FuIIe jsKdXk68M1xlFuh67WWQcxg+ZYZFwj7N8YDAfljfpTccHmPymGmbHVq8T62ALxJt OINSzO+zvh82S9AYpsxT =uwT0 -----END PGP SIGNATURE----- |
From: augustin <aug...@ov...> - 2010-08-24 15:13:28
|
On Tuesday 24 August 2010 09:07:21 pm Artyom wrote: > If entry form fails validation you may just display any message you want > outside widgets system. i.e. > > if(request().request_method()=="POST") { > my_content.my_form.load(context()); > if(!my_content.my_form.validate()) { > my_content.fail_flag = true; > } > } > > And in template system itself > > <% if fail_flag %> > <strong>FAILED</strong> > <% end %> > <form ... > > <% form as_p my_form %> > </form> > Thank you, Artyom. That's not exactly what I wanted to do, but you put me back on the right track. I wanted to be able to add messages for the user from within my_content.my_form.validate(). What I did is create a struct to hold messages: struct user_messages { std::list<std::string> messages; }; I add this struct to my base_content and pass it by reference to my_content.my_form.validate() so that I can populate it with actual messages according to the validation process. Then I can output it within the template using a foreach loop. There may be better ways, but it works for now. When I have more experience, I might come up with a more elegant solution. > See example of forms. Yes, I had studied it closely. Your examples are very useful and I reproduced them to learn from them. > Also you can specify a number of reasons > and add some flag to form you are created. I am not too sure what you are referring to, here. > No, http::context just preservers specific information for single > request/response. You can't change or alter it. Ok. That was my mistake. I was trying to store temporary data (i.e. data related to the current request only) somewhere in http::context instead of putting it into my class derived from cppcms::base_content, as you suggested above. Anyway, your reply was very useful, as usual, and I managed to do more or less what I wanted. Thank you. Augustin. -- Friends: http://www.reuniting.info/ http://activistsolutions.org/ My projects: http://astralcity.org/ http://3enjeux.overshoot.tv/ http://linux.overshoot.tv/ http://overshoot.tv/ http://charityware.info/ http://masquilier.org/ http://openteacher.info/ http://minguo.info/ http://www.wechange.org/ http://searching911.info/ . |
From: Artyom <art...@ya...> - 2010-08-24 13:07:33
|
> > I've been trying to work with http::context but with no success. > > I am working with forms. During the validation process, I want to set some > messages to display to the user. > > I have seen widgets::base_widget::error_message() but this is not what I need. > > I want to: > 1) be able to set errors for the *whole* form, not a specific widget. > 2) be able to set various messages that are valid only within a specific > context (http get/post request). If entry form fails validation you may just display any message you want outside widgets system. i.e. if(request().request_method()=="POST") { my_content.my_form.load(context()); if(!my_content.my_form.validate()) { my_content.fail_flag = true; } } And in template system itself <% if fail_flag %> <strong>FAILED</strong> <% end %> <form ... > <% form as_p my_form %> </form> See example of forms. Also you can specify a number of reasons and add some flag to form you are created. > > If I understand well, I cannot set those message within my cppcms::application > > namespace, since it is shared between all processes, regardless of user or > sessions (?). Thus a message intended for one user might be displayed for > another user. > > I could use the user session, but a message intended for one page (form > submission() might appear on another tab, as the user browses other pages > within the site (race condition?). I don't understand. What do you mean message? What do you mean shared? What race condition? > > It appeared to me that the http::context might be the best place to store > temporary messages that I could retrieve and display at the end of the > request. No, http::context just preservers specific information for single request/response. You can't change or alter it. > > But I have tried and failed. I am not too sure if it's possible and how to go > about it. I have tried to add members to the context object. If it's possible > to do so, I did it the wrong way. You can't and shouldn't derive from context. Artyom |
From: augustin <aug...@ov...> - 2010-08-24 09:52:51
|
Hello, I've been trying to work with http::context but with no success. I am working with forms. During the validation process, I want to set some messages to display to the user. I have seen widgets::base_widget::error_message() but this is not what I need. I want to: 1) be able to set errors for the *whole* form, not a specific widget. 2) be able to set various messages that are valid only within a specific context (http get/post request). If I understand well, I cannot set those message within my cppcms::application namespace, since it is shared between all processes, regardless of user or sessions (?). Thus a message intended for one user might be displayed for another user. I could use the user session, but a message intended for one page (form submission() might appear on another tab, as the user browses other pages within the site (race condition?). It appeared to me that the http::context might be the best place to store temporary messages that I could retrieve and display at the end of the request. But I have tried and failed. I am not too sure if it's possible and how to go about it. I have tried to add members to the context object. If it's possible to do so, I did it the wrong way. Thanks, Augustin. -- Friends: http://www.reuniting.info/ http://activistsolutions.org/ My projects: http://astralcity.org/ http://3enjeux.overshoot.tv/ http://linux.overshoot.tv/ http://overshoot.tv/ http://charityware.info/ http://masquilier.org/ http://openteacher.info/ http://minguo.info/ http://www.wechange.org/ http://searching911.info/ . |
From: Artyom <art...@ya...> - 2010-08-23 06:27:24
|
> Let's assume that I am using nginx with one backend of ten processes. > That means, my webserver can handle ten processes at a time and that if an > eleventh request arrive, its execution will be delayed. This is not correct. Web server forwards all requests directly to the cppcms process even if it is a single one (and in asynchronous applications you do have a single process) So all 11 request will be forwarded without any delay or jam. Single cppcms process can handle lots of requests simultaneously. Artyom |
From: <jc...@ol...> - 2010-08-22 20:51:09
|
Hello, > See <http://art-blog.no-ip.info/cppcms/blog/post/47> Fine setup! Let's assume that I am using nginx with one backend of ten processes. That means, my webserver can handle ten processes at a time and that if an eleventh request arrive, its execution will be delayed. There is no way to increase the number of backend nor the number of processes. With the above setup, let's say that ten requests are waiting for some messages; an eleventh request will be delayed... Is there a way around that jam? Thanks! > >> > Artyom > > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by > > Make an app they can't live without > Enter the BlackBerry Developer Challenge > http://p.sf.net/sfu/RIM-dev2dev > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |
From: Artyom <art...@ya...> - 2010-08-22 19:37:45
|
See: http://cppcms.svn.sourceforge.net/viewvc/cppcms/wikipp/branches/for_cppcms_v100/ It is not in trunk, it is in branch Artyom > Where can I find the CMake file sources for wikipp? Even in SVN trunk > I'm just able to find the standard ./configure, make make install > configuration. |
From: Julian P. <ju...@wh...> - 2010-08-22 19:22:34
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 21.08.2010 10:36, schrieb Artyom: >> Just have to play a bit with the CMakeList.txt that shall generate my >> templates automatically, doesn't work as it should right now ^^ > > Take a look on wikipp's CMake file sources, it would give you an idea. > > Where can I find the CMake file sources for wikipp? Even in SVN trunk I'm just able to find the standard ./configure, make make install configuration. Thanks, Julian -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.15 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQIcBAEBAgAGBQJMcXjtAAoJENidYKvYQHlQ4wEP/A7lCKEkxSJZE6JPgwOB3k39 ryuYllzIpk5FeR+nkmkz8td4eWydcaMe7Mo+YmCsEBrDQPq/9+Eq5ihCgTd4XgWp rarWRz8xoJctinBP4ZXHLPUdz/Rwl871F3NJbkChXaU/RjcCHJ5w6zs2KwekP1Z/ iJMPgmdbvrvFZgEwwlv7K3oQWK193BA/eUsxFs1mxVVQoIcvvLD40i6HEJzn1ICa 8I/lv4TImxtIqTyl6Y/f2nmAYNRovWNznWGjJa3TgtSauNatHm9sfhhUKPLz/SGB X/SZ5AOHAb9Ca+8ziHGvgC9EDoRsd4xVDzpfAjD5IMo9/j/Flk11FO9ScMTGyl+a a1VwpiK4BeaftSnZxz2eaHFsCn0vFDm/wiWpjKdlKkuMxG+u5I+OVZk2DFSWZdla hJNeyHJghjH8iP7tnCjMD7IUl6qs6M4oCaQAuCCy3oiZpVTGKM2tv5d2Iioo+HIn a1YcvCiV34V+8X4AtCpqZcJafEn+ivKMbc+BULLFFHBAX/EnqK9REcbb5Gq8pgI+ km5TxeHRKivQqZ/IfNyMJe+K2Z7KBHIg5FukX+Nu2AxxFSISxz3gxqhPxvDSSW7g 97WO+SOiLwpZvxWk8yU3ntcv0CeFt2oBfGevKhSB5gBd/sIOqd6+jDwOpZLBUNes SUsMVACLP0Y2slAIyH29 =zS4O -----END PGP SIGNATURE----- |
From: Artyom <art...@ya...> - 2010-08-22 19:10:04
|
> > service.applications_pool().mount(cppcms::applications_factory<chat>()); > You should use asynchronous application for handing COMET request. This would not work as it should not. Asynchronous applications mounted directly by their instance rather then using factory class. Unlike ordinary applications that created by some factory class and may have several instances in pool, asynchronous one have single instance in order to handle all incoming multiple request. See <http://art-blog.no-ip.info/cppcms/blog/post/47> > Artyom |
From: Artyom <art...@ya...> - 2010-08-22 18:58:56
|
Hello All, I've got recently lots of questions about how to configure CppCMS to work with web-servers I've created a tutorial on how to configure different web servers to work with CppCMS: <http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_tut_web_server_config> Web Servers: Apache, Lighttpd, Nginx Protocols: FastCGI, SCGI over Unix sockets or TCP/IP Start control: by web server or independent. Regards, Artyom P.S.: If there any windows user who knows how to confugure and run CppCMS with IIS over FastCGI and tcp/ip, please add to this tutorial. There should not be any specific problem, but I don't have IIS and I'm not wiling to install and test one :-) |
From: <cn...@gr...> - 2010-08-21 10:01:28
|
Hi! I am trying to get the rationale of cppCMS. I modified the "chat" example as follows but the system then runs very slowly. My browser does not echo the first message in 8 seconds. And since it doesn't echo the second message in minutes, so I killed the server. Both the server and browser run in the same host. Can it be a problem in chat.cpp or the script in the_chat.html? ----------- int main(int argc,char **argv) { try { cppcms::service service(argc,argv); /* booster::intrusive_ptr<chat> c=new chat(service); service.applications_pool().mount(c); */ service.applications_pool().mount(cppcms::applications_factory<chat>()); //slow! service.run(); } catch(std::exception const &e) { std::cerr<<"Catched exception: "<<e.what()<<std::endl; return 1; } return 0; } --------- Regards, CN |
From: augustin <aug...@ov...> - 2010-08-21 10:00:57
|
Hello Artyom, Is it possible for you to adjust the mailing list configuration? In my mail client (Kmail), the author of all the emails is "cppcms- us...@li...". One has to open each email individually to see the real author (Frank, Artyom, etc.) In other mailing lists I am subscribed to, the author of each email is properly displayed within the threaded summary list. I hope it's only a setting that can be easily adjusted in the mailing list server... Thanks, Augustin. -- Friends: http://www.reuniting.info/ http://activistsolutions.org/ My projects: http://astralcity.org/ http://3enjeux.overshoot.tv/ http://linux.overshoot.tv/ http://overshoot.tv/ http://charityware.info/ http://masquilier.org/ http://openteacher.info/ http://minguo.info/ http://www.wechange.org/ http://searching911.info/ . |
From: Frank E. <fra...@an...> - 2010-08-21 09:12:32
|
agreed. youre right. On Aug 21, 2010, at 10:31, Artyom <art...@ya...> wrote: > No, as policy, CppCMS uses Cookies based sessions only as > adding SID to URL like in PHP has major security issues, for example > the sid is exposed by browser in referrer link and allows SID to > be stolen: > > i.e. > > page www.foo.com/url?sid=1234566 > > > link to www.bar.com > > Now user clicks on the link and now on bar.com I have > > Referrer: http://www.foo.com/url?sid=1234566 > > And now it can login to foo.com with your account. This is bad. > >> >> Another question: is it possible to have the session id to be >> transparently added as a url parameter, when cookies are not available >> (such as php does this)? >> >> thank, > > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by > > Make an app they can't live without > Enter the BlackBerry Developer Challenge > http://p.sf.net/sfu/RIM-dev2dev > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users |
From: Artyom <art...@ya...> - 2010-08-21 09:03:42
|
>p4:/usr/src/cppcms-0.99.2.1/examples/hello_world# cppcms_run hello -c config.js > >Web Server Port:8080 >Api:http >Service IP:127.0.0.1 >Service Port:8080 >Server:/usr/sbin/apache2 -f You are running with cppcms_run an application via HTTP proxy (i.e. api:http) but by default the application uses 8080 and so apache uses 8080 - you can't do this. You need either: 1. Use cppcms's internal web server so you need to run ./hello -c config.js without cppcms_run at all. 2. Use fastcgi, scgi over unix socket or fcgi/scgi/http over TCP/IP port different from web server's one. Artom |
From: Artyom <art...@ya...> - 2010-08-21 08:36:23
|
> Just have to play a bit with the CMakeList.txt that shall generate my > templates automatically, doesn't work as it should right now ^^ Take a look on wikipp's CMake file sources, it would give you an idea. |
From: Artyom <art...@ya...> - 2010-08-21 08:34:21
|
Yes, the blog with written on base of CppCMS 0.0.x. You can take it from SVN and use it. It is stable and useful. I didn't released it as it has several major issues: - It uses old CppCMS in very bad style (it was first CppCMS application I had written) and it is hard to convert to new one. - It has very bad authentication system (does not use CppCMS's sessions) Artyom > >From: David Elrom <dav...@gm...> >To: cpp...@li... >Sent: Sat, August 21, 2010 3:51:13 AM >Subject: [Cppcms-users] cppcms blog > >Artyom, > >The development blog you use, is it written using cppcms? Would you be willing >to release it? > >I need a nice, clean (and simple) blog app, and i'm trying to avoid wordpress >and the like... > >I was going to just write one using cppcms but then realized you may have >already done so. > >Thanks, >-elrom > |
From: Artyom <art...@ya...> - 2010-08-21 08:31:51
|
No, as policy, CppCMS uses Cookies based sessions only as adding SID to URL like in PHP has major security issues, for example the sid is exposed by browser in referrer link and allows SID to be stolen: i.e. page www.foo.com/url?sid=1234566 link to www.bar.com Now user clicks on the link and now on bar.com I have Referrer: http://www.foo.com/url?sid=1234566 And now it can login to foo.com with your account. This is bad. > > Another question: is it possible to have the session id to be > transparently added as a url parameter, when cookies are not available > (such as php does this)? > > thank, |
From: <cn...@gr...> - 2010-08-21 07:38:32
|
Hi! My Opera browser complains "Could not connect to remote server". So is http://127.0.0.1:8080/hello. Regards, CN -----Original Message----- From: David Elrom <dav...@gm...> Point your webbrowser at 127.0.0.1:8080 . What do you see? On Aug 21, 2010 3:14 AM, <cn...@gr...> wrote: Hi! I get "system: Address already in use" error with service.port:8080. This error is gone if port 80 is configured instead. I am sure that no other apache2 instance is running (in Debian Lenny). What makes this conflict? Regards, CN ---------------------------- p4:/usr/src/cppcms-0.99.2.1/examples/hello_world# cppcms_run hello -c config.js Web Server Host:127.0.0.1 Web Server Port:8080 Document Root:/usr/src/cppcms-0.99.2.1/examples/hello_world Script:/hello Api:http Service IP:127.0.0.1 Service Port:8080 Server:/usr/sbin/apache2 -f /usr/src/cppcms-0.99.2.1/examples/hello_world/cppcms_rundir/apache.conf Starting Application Server:/hello Application Server PID:5337 Starting Web Server apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName system: Address already in use Web Server PID:5339 ------------------------------------ - Press Any Key To Stop The Server - |
From: David E. <dav...@gm...> - 2010-08-21 07:19:39
|
Point your webbrowser at 127.0.0.1:8080 . What do you see? On Aug 21, 2010 3:14 AM, <cn...@gr...> wrote: Hi! I get "system: Address already in use" error with service.port:8080. This error is gone if port 80 is configured instead. I am sure that no other apache2 instance is running (in Debian Lenny). What makes this conflict? Regards, CN ---------------------------- p4:/usr/src/cppcms-0.99.2.1/examples/hello_world# cppcms_run hello -c config.js Web Server Host:127.0.0.1 Web Server Port:8080 Document Root:/usr/src/cppcms-0.99.2.1/examples/hello_world Script:/hello Api:http Service IP:127.0.0.1 Service Port:8080 Server:/usr/sbin/apache2 -f /usr/src/cppcms-0.99.2.1/examples/hello_world/cppcms_rundir/apache.conf Starting Application Server:/hello Application Server PID:5337 Starting Web Server apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName system: Address already in use Web Server PID:5339 ------------------------------------ - Press Any Key To Stop The Server - ------------------------------------ ------------------------------------------------------------------------------ This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev _______________________________________________ Cppcms-users mailing list Cpp...@li... https://lists.sourceforge.net/lists/listinfo/cppcms-users |
From: David E. <dav...@gm...> - 2010-08-21 07:18:14
|
It's a part of the interface. The base cmsapplication you are inheriting from specifies that method. Other parts of cms call that method, except since you override it, your method gets called... On Aug 21, 2010 3:11 AM, <cn...@gr...> wrote: Hi! The original example "Hello, World!" code follows: ------------------ class my_hello_world : public cppcms::application { public: my_hello_world(cppcms::service &srv) : cppcms::application(srv) { } virtual void main(std::string url); }; void my_hello_world::main(std::string /*url*/) { response().out()<< "<html>\n" "<body>\n" " <h1>Hello World</h1>\n" "</body>\n" "</html>\n"; } int main(int argc,char ** argv) { try { cppcms::service srv(argc,argv); srv.applications_pool().mount(cppcms::applications_factory<my_hello_world>()); srv.run(); } catch(std::exception const &e) { std::cerr<<e.what()<<std::endl; } } ------------- What I don't understand is why member function void my_hello_world::main(std::string) is called automatically when client requests the URL. I changed the member function name "main" to "xmain" as below, then it stops working: ------------- class my_hello_world : public cppcms::application { public: my_hello_world(cppcms::service &srv) : cppcms::application(srv) { } virtual void xmain(std::string url); }; void my_hello_world::xmain(std::string /*url*/) ... ------------- Does this belong to cppCMS coding convention or something else? Best Regards, CN ------------------------------------------------------------------------------ This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev _______________________________________________ Cppcms-users mailing list Cpp...@li... https://lists.sourceforge.net/lists/listinfo/cppcms-users |
From: <cn...@gr...> - 2010-08-21 07:14:37
|
Hi! I get "system: Address already in use" error with service.port:8080. This error is gone if port 80 is configured instead. I am sure that no other apache2 instance is running (in Debian Lenny). What makes this conflict? Regards, CN ---------------------------- p4:/usr/src/cppcms-0.99.2.1/examples/hello_world# cppcms_run hello -c config.js Web Server Host:127.0.0.1 Web Server Port:8080 Document Root:/usr/src/cppcms-0.99.2.1/examples/hello_world Script:/hello Api:http Service IP:127.0.0.1 Service Port:8080 Server:/usr/sbin/apache2 -f /usr/src/cppcms-0.99.2.1/examples/hello_world/cppcms_rundir/apache.conf Starting Application Server:/hello Application Server PID:5337 Starting Web Server apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName system: Address already in use Web Server PID:5339 ------------------------------------ - Press Any Key To Stop The Server - ------------------------------------ |
From: <cn...@gr...> - 2010-08-21 07:11:01
|
Hi! The original example "Hello, World!" code follows: ------------------ class my_hello_world : public cppcms::application { public: my_hello_world(cppcms::service &srv) : cppcms::application(srv) { } virtual void main(std::string url); }; void my_hello_world::main(std::string /*url*/) { response().out()<< "<html>\n" "<body>\n" " <h1>Hello World</h1>\n" "</body>\n" "</html>\n"; } int main(int argc,char ** argv) { try { cppcms::service srv(argc,argv); srv.applications_pool().mount(cppcms::applications_factory<my_hello_world>()); srv.run(); } catch(std::exception const &e) { std::cerr<<e.what()<<std::endl; } } ------------- What I don't understand is why member function void my_hello_world::main(std::string) is called automatically when client requests the URL. I changed the member function name "main" to "xmain" as below, then it stops working: ------------- class my_hello_world : public cppcms::application { public: my_hello_world(cppcms::service &srv) : cppcms::application(srv) { } virtual void xmain(std::string url); }; void my_hello_world::xmain(std::string /*url*/) ... ------------- Does this belong to cppCMS coding convention or something else? Best Regards, CN |
From: Julian P. <ju...@wh...> - 2010-08-21 01:03:56
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Ok, implemented this solution and it works! Brings me a big step closer to what I want. Just have to play a bit with the CMakeList.txt that shall generate my templates automatically, doesn't work as it should right now ^^ Many thanks, Julian -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.15 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQIcBAEBAgAGBQJMbyXxAAoJENidYKvYQHlQ0S8P/jWM69Z9cVblEvy0XEczeRMG 5yTHjJ+d4DahwfRa6c4sR2yLJmOw3B/RsJniNvmLGSyIEgiKLepDUj4esNtsSSrN HkWmQKv5eWZbs/yYQ8H1F0zc6oNAS1PNFnVHrPvf78y5evY3e74BhChIWWIJPRzE Nfr1qqC98h7y/R2QfT2Ec0XGxyEKdwcL/ZbF1PlMH2nB/kIWd/KpSA0QfZZvozhF 643OdsePFRdAm1c4gn4HiTx6kg3cRIGFg27HNMsdjPBu0+v0AYdKTEc/QASfV2E9 UQ964wEf5YFU4HHJ5tp0KIJ/1+X8BGgfTarDuvBftrYS9KSJLxAiRx+VdW65nWuX U67UpeZl+Dcxm5djpZHfp//xEzJ5Mdiz9kmLdLZ8iW90lRkIvNqe+rCixgxWEpa2 wPf4YzI3Fob1uvCHPifAuWAU19zPxWMeGLabmyIIMNBMe3F+Z7o/hhEl9LJCKn6U LXk0osDDTzZP53MjU4MV63lxSi8b1vzev4+8uddRMbt0amIEzGq9Y3j39KASibJA YumtxJic5e6GfdEw2oSQ/UqBvPSeouKdE+Zir7BinfcEMo6Mc3xqG7b00aY10eF4 31NXue6AyGgqpZxDJx3mJB6lBoFnIIlszoe8aR+eZX+cGGEwqVImQaq390fIYTUf BAnbDJlhKUJkYP61Sc9r =PMyE -----END PGP SIGNATURE----- |
From: David E. <dav...@gm...> - 2010-08-21 00:51:39
|
Artyom, The development blog you use, is it written using cppcms? Would you be willing to release it? I need a nice, clean (and simple) blog app, and i'm trying to avoid wordpress and the like... I was going to just write one using cppcms but then realized you may have already done so. Thanks, -elrom |