Re: Help with HttpRequest Handling
Em Wed, 02 Dec 2009 10:38:59 -0200, Ashwanth Kumar escreveu: Thanks yar, You're welcome! I tired this, and got it working! :) @Inject private HttpServletRequest _request; Injecting the Request service would also work and it's the recommended choice. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, software architect and developer, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Help with HttpRequest Handling
Thanks yar, I tired this, and got it working! :) @Inject private HttpServletRequest _request; Now, i'm able to access the Session info, across all sessions! Thanks a lot, for the help! I did get to know, better! - Ashwanth On Wed, Dec 2, 2009 at 5:59 PM, Thiago H. de Paula Figueiredo < thiag...@gmail.com> wrote: > Em Wed, 02 Dec 2009 09:57:50 -0200, Ashwanth Kumar < > ashwanth.ku...@gmail.com> escreveu: > > > But Thiago, >> I tired, but each and every time, i do so, i get just 1 each time!! Plz >> help! >> > > Every Tapestry service (including Request) is wrapped by a proxy. When the > service is per thread, this proxy invokes the methods in the correct object > for that thread. It is a little bit strange at first, but it works. > > > -- > Thiago H. de Paula Figueiredo > Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, > and instructor > Owner, software architect and developer, Ars Machina Tecnologia da > Informação Ltda. > http://www.arsmachina.com.br > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >
Re: Help with HttpRequest Handling
Em Wed, 02 Dec 2009 09:57:50 -0200, Ashwanth Kumar escreveu: But Thiago, I tired, but each and every time, i do so, i get just 1 each time!! Plz help! Every Tapestry service (including Request) is wrapped by a proxy. When the service is per thread, this proxy invokes the methods in the correct object for that thread. It is a little bit strange at first, but it works. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, software architect and developer, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Help with HttpRequest Handling
But Thiago, I tired, but each and every time, i do so, i get just 1 each time!! Plz help! - Ashwanth On Wed, Dec 2, 2009 at 4:42 PM, Thiago H. de Paula Figueiredo < thiag...@gmail.com> wrote: > Em Wed, 02 Dec 2009 02:38:05 -0200, Ashwanth Kumar < > ashwanth.ku...@gmail.com> escreveu: > > Thiago, >> > > Hi! > > > Thanks for the reply. As u said, i did use sessions. But my problem, how >> am i to access it? I mean, if i use RequestGlobals, i get per request >> session. >> And, if i use Request service also, i get the same thing! How am i access >> it? (Actually thats wat i tired to mean by non-threaded stuff, sorry!) >> > > There's no such thing as a per request session. Just @Inject Request and > get the session. It'll work. > > > -- > Thiago H. de Paula Figueiredo > Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, > and instructor > Owner, software architect and developer, Ars Machina Tecnologia da > Informação Ltda. > http://www.arsmachina.com.br > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >
Re: Help with HttpRequest Handling
Em Wed, 02 Dec 2009 02:38:05 -0200, Ashwanth Kumar escreveu: Thiago, Hi! Thanks for the reply. As u said, i did use sessions. But my problem, how am i to access it? I mean, if i use RequestGlobals, i get per request session. And, if i use Request service also, i get the same thing! How am i access it? (Actually thats wat i tired to mean by non-threaded stuff, sorry!) There's no such thing as a per request session. Just @Inject Request and get the session. It'll work. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, software architect and developer, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Help with HttpRequest Handling
Thiago, Thanks for the reply. As u said, i did use sessions. But my problem, how am i to access it? I mean, if i use RequestGlobals, i get per request session. And, if i use Request service also, i get the same thing! How am i access it? (Actually thats wat i tired to mean by non-threaded stuff, sorry!) - Ashwanth On Wed, Dec 2, 2009 at 7:55 AM, Thiago H. de Paula Figueiredo < thiag...@gmail.com> wrote: > Em Tue, 01 Dec 2009 23:59:48 -0200, Ashwanth Kumar < > ashwanth.ku...@gmail.com> escreveu: > > Hi, >> > > Hi! > > I want to write a simple component, which will say the number of users >> online! But, to do, that i need to access the non-threaded version of >> HttpServletRequest of the Tapestry servlet, how do i do that? Please help >> me! >> > > Some points: > > 1) Tapestry is a servlet filter, not a servlet. > > 2) There isn't a non-threaded version of HttpServletRequest, as it is > created for every request received. > > 3) As far as I know, it's not possible to count the number of concurrent > users without using the session, as HTTP is a stateless protocol. You'll > need to count open sessions. To do that, you'll need a service to hold the > number of open sesions and an HttpSessionListener. > > I hope I gave you some pointers. > > > -- > Thiago H. de Paula Figueiredo > Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, > and instructor > Owner, software architect and developer, Ars Machina Tecnologia da > Informação Ltda. > http://www.arsmachina.com.br > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >
Re: Help with HttpRequest Handling
Em Tue, 01 Dec 2009 23:59:48 -0200, Ashwanth Kumar escreveu: Hi, Hi! I want to write a simple component, which will say the number of users online! But, to do, that i need to access the non-threaded version of HttpServletRequest of the Tapestry servlet, how do i do that? Please help me! Some points: 1) Tapestry is a servlet filter, not a servlet. 2) There isn't a non-threaded version of HttpServletRequest, as it is created for every request received. 3) As far as I know, it's not possible to count the number of concurrent users without using the session, as HTTP is a stateless protocol. You'll need to count open sessions. To do that, you'll need a service to hold the number of open sesions and an HttpSessionListener. I hope I gave you some pointers. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, software architect and developer, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Help with HttpRequest Handling
Hi, I want to write a simple component, which will say the number of users online! But, to do, that i need to access the non-threaded version of HttpServletRequest of the Tapestry servlet, how do i do that? Please help me! - Ashwanth