Hi Thomas, I was looking at the code, there isn't a central place creating a PageProvider, which makes sense since it is designed to be created in multiple ways. I had another idea and I think it is best to create a custom MountedMapper that overrides the mapRequest method to implement your logic.
Pedro Henrique Oliveira dos Santos 2011/12/14 Thomas Götz <t...@decoded.de> > Yes, that was what I had in mind. But where can I configure my custom > PageProvider (i.e. that Wicket knows that my PageProvider implementation > should be used)? > > Cheers, > -Tom > > > Pedro Santos wrote: > > > You can override the PageProvider#getPageInstance method and test for the > > target page class. If there are no instance for its page id and it is one > > of those pages you want to reply to user a page expired message rather > than > > reply a fresh instance you throw a PageExpiredException exception (not > > a StalePageException, StalePageException is for another case ). > > > > Pedro Henrique Oliveira dos Santos > > > > > > 2011/12/14 Thomas Götz <t...@decoded.de (mailto:t...@decoded.de)> > > > > > Don't know either, but since I don't have any other idea at the moment: > > > how would I do this? > > > > > > Cheers, > > > -Tom > > > > > > > > > Pedro Santos wrote: > > > > > > > Bleh, my bad, PageProvider will give you a fresh page since the > > > > MountedMapper were able to resolve the target page class. > > > > You can customize PageProvider to throw a StalePageException based on > > > > custom rules. Don't know if it's the best option. > > > > > > > > Pedro Henrique Oliveira dos Santos > > > > > > > > > > > > 2011/12/14 Thomas Götz <t...@decoded.de (mailto:t...@decoded.de)> > > > > > > > > > Can you give an example? AFAIK the pageId *is* already encoded in > the > > > URL > > > > > bei Wicket, i.e. the URL changes to http://my.domain/foobar?0when the > > > > > page is rendered. Doing AJAX requests on the page does not change > the > > > > > > > > > > > > > URL > > > > > though … > > > > > > > > > > Cheers, > > > > > -Tom > > > > > > > > > > > > > > > Pedro Santos wrote: > > > > > > > > > > > Hi Thomas, encoding the page ID in the URL would respond an > expired > > > page. > > > > > > > > > > > > Pedro Henrique Oliveira dos Santos > > > > > > > > > > > > > > > > > > 2011/12/14 Thomas Götz <t...@decoded.de (mailto:t...@decoded.de)> > > > > > > > > > > > > > The situation: > > > > > > > > > > > > > > I have a mounted page containing several AJAX components. > Whenever > > > the > > > > > > > session expires and an AJAX request is triggered afterwards, a > new > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > instance > > > > > > > of the page is (silently) created which is normal behavior I > > > > > > > > > > > > > > > > > > > > > > > > suppose > > > > > > > > > > > > > > > > > > > > > > > > > (when > > > > > > > looking at PageProvider.resolvePageInstance(…)). > > > > > > > > > > > > > > Can I hook into that somehow? I'd like to show some custom > > > > > > > please-restart-you-session-by-clicking-here ExpiredPage, but > > > > > > > > > > > > > > > > > > > > > > > > there's no > > > > > > > PageExpiredException thrown (which is a good thing), but > > > > > > > > > > > > > > > > > > > > > > > > nevertheless > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > I'd > > > > > > > prefer to show something to the user. > > > > > > > > > > > > > > Can someone point me into the right direction? > > > > > > > > > > > > > > Cheers, > > > > > > > -Tom > > > > > > > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > > > > To unsubscribe, e-mail: > > > > > > > users-unsubscr...@wicket.apache.org(mailto: > users-unsubscr...@wicket.apache.org)(mailto: > > > > > > > > > > > > > > > > > > > > > > > > users-unsubscr...@wicket.apache.org (mailto: > users-unsubscr...@wicket.apache.org)) (mailto: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > users-unsubscr...@wicket.apache.org (mailto: > users-unsubscr...@wicket.apache.org) (mailto: > > > users-unsubscr...@wicket.apache.org (mailto: > users-unsubscr...@wicket.apache.org))) > > > > > > > For additional commands, e-mail: > > > > > > > users-h...@wicket.apache.org(mailto: > users-h...@wicket.apache.org)(mailto: > > > > > > > > > > > > > > > > > > > > > > > > users-h...@wicket.apache.org (mailto:users-h...@wicket.apache.org)) > (mailto: > > > > > > > > > > > > > > > > > > > > > > > > > users-h...@wicket.apache.org (mailto:users-h...@wicket.apache.org > )) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org(mailto: > users-unsubscr...@wicket.apache.org) (mailto: > > > > > > > > > > > > > users-unsubscr...@wicket.apache.org (mailto: > users-unsubscr...@wicket.apache.org)) > > > > > For additional commands, e-mail: users-h...@wicket.apache.org(mailto: > users-h...@wicket.apache.org) (mailto: > > > > > > > > > > > > > users-h...@wicket.apache.org (mailto:users-h...@wicket.apache.org)) > > > > > > > > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org (mailto: > users-unsubscr...@wicket.apache.org) > > > For additional commands, e-mail: users-h...@wicket.apache.org (mailto: > users-h...@wicket.apache.org) > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >