How does "Referer" header value looks like?, is it a bookmarkable url? Try HybridUrlCodingStrategy<http://wicket.apache.org/apidocs/1.4/org/apache/wicket/request/target/coding/HybridUrlCodingStrategy.html> when mounting those pages and check.
On Sat, May 14, 2011 at 3:18 PM, Alec Swan [via Apache Wicket] < ml-node+3522892-1695417627-65...@n4.nabble.com> wrote: > I put the following code in RequestCycle#onRuntimeException() but it > redirects me to Wicket's "Page Expired" page?! > > if (e instanceof PageExpiredException) { > final HttpServletRequest httpServletRequest = > ((WebRequest) getRequest()).getHttpServletRequest(); > final String referrerUrl = > httpServletRequest.getHeader("Referer"); > > if (referrerUrl != null) { > setRequestTarget(new RedirectRequestTarget(referrerUrl)); > return super.onRuntimeException(page, e); > } > } > > Any ideas? > > Alec > > On Sat, May 14, 2011 at 11:21 AM, Alec Swan <[hidden > email]<http://user/SendEmail.jtp?type=node&node=3522892&i=0>> > wrote: > > > Igor, if I understood correctly you recommend redirecting back to tab2 > > from the login page. If so, what is the recommended way to do this? Do > > I get referrer ULR with ((WebRequest) > > getRequest()).getHttpServletRequest().getHeader("Referer") and throw > > some kind of exception which redirects back to that URL in LoginPage > > constructor or do I call continueToOriginalDestination() in the > > LoginPage constructor instead? > > > > Thanks, > > > > Alec > > > > On Sat, May 14, 2011 at 10:32 AM, Igor Vaynberg <[hidden > > email]<http://user/SendEmail.jtp?type=node&node=3522892&i=1>> > wrote: > >> i can only assume that tab 2 is either bookmarkable or hybrid. if it > >> is, you may be able to check the referer header and if its > >> bookmarkable or hybrid redirect back to it. > >> > >> -igor > >> > >> On Sat, May 14, 2011 at 9:15 AM, Alec Swan <[hidden > >> email]<http://user/SendEmail.jtp?type=node&node=3522892&i=2>> > wrote: > >>> In our case login page is the home page. > >>> > >>> Please let me clarify the scenario we need to support: > >>> > >>> 1. Guest opens the website, clicks on tab1 and stays on it for a while > >>> 2. Session times out > >>> 3. Guest clicks on tab2 > >>> Current behavior: Guest is redirected to a login page > >>> Desired behavior: Guest is redirected to tab2 > >>> > >>> Thanks, > >>> > >>> Alec > >>> > >>> On Sat, May 14, 2011 at 12:10 AM, Igor Vaynberg <[hidden > >>> email]<http://user/SendEmail.jtp?type=node&node=3522892&i=3>> > wrote: > >>>> so for guests do not return the login page, but a homepage instead... > >>>> > >>>> -igor > >>>> > >>>> On Fri, May 13, 2011 at 9:03 PM, Alec Swan <[hidden > >>>> email]<http://user/SendEmail.jtp?type=node&node=3522892&i=4>> > wrote: > >>>>> The login page is returned from WebRequestCycle#onRuntimeException() > >>>>> and Application#getHomePage() and there is also a > >>>>> RestartResponseAtInterceptPageException(LOGIN_PAGE) thrown from > >>>>> IAuthorizationStrategy#isInstantiationAuthorized(). > >>>>> > >>>>> I am not sure how session timeout is handled by wicket, but I bet > some > >>>>> kind of runtime exception is thrown causing > >>>>> WebRequestCycle#onRuntimeException() to return the login page. > >>>>> > >>>>> Thanks, > >>>>> > >>>>> Alec > >>>>> > >>>>> On Fri, May 13, 2011 at 6:23 PM, Igor Vaynberg <[hidden > >>>>> email]<http://user/SendEmail.jtp?type=node&node=3522892&i=5>> > wrote: > >>>>>> what is redirecting them back? > >>>>>> > >>>>>> -igor > >>>>>> > >>>>>> On Fri, May 13, 2011 at 3:45 PM, Alec Swan <[hidden > >>>>>> email]<http://user/SendEmail.jtp?type=node&node=3522892&i=6>> > wrote: > >>>>>>> Hello, > >>>>>>> > >>>>>>> Our webapp has two types of users - Admins and Guests. Guests can > view > >>>>>>> the site without logging in. However, when the session times out or > > >>>>>>> load-balancer cookie expires Guests, like Admins are redirected to > our > >>>>>>> login page, which confuses the Guests. > >>>>>>> > >>>>>>> What's a good way to redirect Guests back to the page that they > were > >>>>>>> viewing without keeping the session alive with AJAX pings? > >>>>>>> > >>>>>>> Thanks, > >>>>>>> > >>>>>>> Alec > >>>>>>> > >>>>>>> > --------------------------------------------------------------------- > >>>>>>> To unsubscribe, e-mail: [hidden > >>>>>>> email]<http://user/SendEmail.jtp?type=node&node=3522892&i=7> > >>>>>>> For additional commands, e-mail: [hidden > >>>>>>> email]<http://user/SendEmail.jtp?type=node&node=3522892&i=8> > >>>>>>> > >>>>>>> > >>>>>> > >>>>>> > --------------------------------------------------------------------- > >>>>>> To unsubscribe, e-mail: [hidden > >>>>>> email]<http://user/SendEmail.jtp?type=node&node=3522892&i=9> > >>>>>> For additional commands, e-mail: [hidden > >>>>>> email]<http://user/SendEmail.jtp?type=node&node=3522892&i=10> > >>>>>> > >>>>>> > >>>>> > >>>>> --------------------------------------------------------------------- > > >>>>> To unsubscribe, e-mail: [hidden > >>>>> email]<http://user/SendEmail.jtp?type=node&node=3522892&i=11> > >>>>> For additional commands, e-mail: [hidden > >>>>> email]<http://user/SendEmail.jtp?type=node&node=3522892&i=12> > >>>>> > >>>>> > >>>> > >>>> --------------------------------------------------------------------- > >>>> To unsubscribe, e-mail: [hidden > >>>> email]<http://user/SendEmail.jtp?type=node&node=3522892&i=13> > >>>> For additional commands, e-mail: [hidden > >>>> email]<http://user/SendEmail.jtp?type=node&node=3522892&i=14> > >>>> > >>>> > >>> > >>> --------------------------------------------------------------------- > >>> To unsubscribe, e-mail: [hidden > >>> email]<http://user/SendEmail.jtp?type=node&node=3522892&i=15> > >>> For additional commands, e-mail: [hidden > >>> email]<http://user/SendEmail.jtp?type=node&node=3522892&i=16> > >>> > >>> > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: [hidden > >> email]<http://user/SendEmail.jtp?type=node&node=3522892&i=17> > >> For additional commands, e-mail: [hidden > >> email]<http://user/SendEmail.jtp?type=node&node=3522892&i=18> > >> > >> > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [hidden > email]<http://user/SendEmail.jtp?type=node&node=3522892&i=19> > For additional commands, e-mail: [hidden > email]<http://user/SendEmail.jtp?type=node&node=3522892&i=20> > > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://apache-wicket.1842946.n4.nabble.com/Handling-session-and-load-balancer-cookie-timeout-tp3521417p3522892.html > To start a new topic under Apache Wicket, email > ml-node+1842946-398011874-65...@n4.nabble.com > To unsubscribe from Apache Wicket, click > here<http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1842946&code=amNnYXJjaWFtQGdtYWlsLmNvbXwxODQyOTQ2fDEyNTYxMzc3ODY=>. > > -- JC -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Handling-session-and-load-balancer-cookie-timeout-tp3521417p3522923.html Sent from the Users forum mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org