You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by T Ames <ta...@gmail.com> on 2009/08/20 16:53:58 UTC

Custom WebSession and bind()

I have read several posts about how to manually bind stateless pages in a
custom WebSession object to the http session.  In my custom WebSession, I
would like to create some objects, but only if and when the WebSession
actually binds as normal when a stateful page is called up.

Is there a method I can do this in?   The bind() method is final, so I
cannot do it there.  I only want to create these objects once just as if
they were in the constructor. I am assuming that the bind() method is only
called once.

Re: Custom WebSession and bind()

Posted by T Ames <ta...@gmail.com>.
Yes, I had done that. I was hoping there may be a more efficient place to do
this since the attach() method appears to be called several times during the
session life-cycle.

Thanks!



On Thu, Aug 20, 2009 at 11:00 AM, Igor Vaynberg <ig...@gmail.com>wrote:

> maybe something like this...
>
> class mysession {
>  Object object;
>
>   attach() {
>     super.attach();
>     if
> (object==null&&getsessionstore().lookup(requestcycle.get().getrequest())!=null)
> {
>           object=...
>     }}}
>
> -igor
>
> On Thu, Aug 20, 2009 at 7:53 AM, T Ames<ta...@gmail.com> wrote:
> > I have read several posts about how to manually bind stateless pages in a
> > custom WebSession object to the http session.  In my custom WebSession, I
> > would like to create some objects, but only if and when the WebSession
> > actually binds as normal when a stateful page is called up.
> >
> > Is there a method I can do this in?   The bind() method is final, so I
> > cannot do it there.  I only want to create these objects once just as if
> > they were in the constructor. I am assuming that the bind() method is
> only
> > called once.
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Custom WebSession and bind()

Posted by Igor Vaynberg <ig...@gmail.com>.
maybe something like this...

class mysession {
  Object object;

   attach() {
     super.attach();
     if (object==null&&getsessionstore().lookup(requestcycle.get().getrequest())!=null)
{
           object=...
     }}}

-igor

On Thu, Aug 20, 2009 at 7:53 AM, T Ames<ta...@gmail.com> wrote:
> I have read several posts about how to manually bind stateless pages in a
> custom WebSession object to the http session.  In my custom WebSession, I
> would like to create some objects, but only if and when the WebSession
> actually binds as normal when a stateful page is called up.
>
> Is there a method I can do this in?   The bind() method is final, so I
> cannot do it there.  I only want to create these objects once just as if
> they were in the constructor. I am assuming that the bind() method is only
> called once.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org