Thanks to both. Alec approach worked for me in other case, not in this one.

In this case, we had the problem that StaleException was rising, when user
open multiple tabs with the same session (like Firefox)
In that case, I was invalidating the whole session and redirecting to
login. But now, the user stays in the same page (with the last state) using
Session.get().getPageManager().getPage( id )

So now, the user can have multiple tabs and works fine. Thanks to both
Martin and Alec!


On Fri, Nov 16, 2012 at 1:30 PM, Alec Swan <alecs...@gmail.com> wrote:

> I used this approach
> https://cwiki.apache.org/WICKET/requestcycle-in-wicket-15.html to
> retrieve the last page instance from request cycle.
>
> 1. Register handler in your Application:
> getRequestCycleListeners().add(new PageRequestHandlerTracker());
> 2. Retrieve page as follows:
> IPageRequestHandler lastHandler =
> PageRequestHandlerTracker.getLastHandler(RequestCycle.get());
> IRequestablePage page = lastHandler == null ? null : lastHandler.getPage();
>
> Hope this helps,
>
> Alec
>
> On Fri, Nov 16, 2012 at 8:55 AM, Martin Grigorov <mgrigo...@apache.org>
> wrote:
> > Why do you need this functionality ?
> >
> >
> > On Fri, Nov 16, 2012 at 5:54 PM, Alfonso Quiroga <alfonsose...@gmail.com
> >wrote:
> >
> >> Martin, thank you again!
> >> This helps me a lot! what I dislike is that I need to know the page id,
> is
> >> there a way to know the "last" page id? by now.. I'll put this id in the
> >> session
> >>
> >>
> >> On Fri, Nov 16, 2012 at 11:47 AM, Martin Grigorov <mgrigo...@apache.org
> >> >wrote:
> >>
> >> > Hi,
> >> >
> >> > The official way is: session.getPageManager().getPage(pageId)
> >> > This will look in the httpsession and fallback to disk.
> >> >
> >> >
> >> > On Fri, Nov 16, 2012 at 4:33 PM, Alfonso Quiroga <
> alfonsose...@gmail.com
> >> > >wrote:
> >> >
> >> > > Hi, is there a way to get the actual IRequestablePage? I have only
> one,
> >> > and
> >> > > if I debug the HttpSession, I have this key:
> >> > > "wicket:wicket.wicketGuide:wicket:persistentPageManagerData" which
> >> holds
> >> > > the PageStoreManager$SessionEntry, where is the actual page I'm
> looking
> >> > > for.
> >> > >
> >> > > I don't want to access in that way (navigating throw the raw
> >> > httpSession).
> >> > > I think there should be a better way using Wicket classes. Does
> anybody
> >> > > know? thanks!
> >> > >
> >> >
> >> >
> >> >
> >> > --
> >> > Martin Grigorov
> >> > jWeekend
> >> > Training, Consulting, Development
> >> > http://jWeekend.com <http://jweekend.com/>
> >> >
> >>
> >
> >
> >
> > --
> > Martin Grigorov
> > jWeekend
> > Training, Consulting, Development
> > http://jWeekend.com <http://jweekend.com/>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

Reply via email to