You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Dale Ogilvie <Da...@trimble.com> on 2012/06/01 00:18:28 UTC

RE: Specified expiration page not being shown

After more investigation it seems that wicket 1.4.20 is not always
displaying the expired page if session expires on a form and the form
button link resolves to a url mounted using QueryStringUrlCodingStrategy

        mount(new QueryStringUrlCodingStrategy("test",HomePage.class));

the relevant bit of code in WebRequestCycleProcessor is below,
requestCodingStrategy will return a target if path is not null, even if
session is dead.

// NOTE we are doing the mount check as the last item, so that it will
// only be executed when everything else fails. This enables URLs like
// /foo/bar/?wicket:bookmarkablePage=my.Page to be resolved, where
// is either a valid mount or a non-valid mount. I (Eelco) am not
// absolutely sure this is a great way to go, but it seems to have been
// established as the default way of doing things. If we ever want to
// tighten the algorithm up, it should be combined by going back to
// unmounted paths so that requests with Wicket parameters like
// 'bookmarkablePage' are always created and resolved in the same
// fashion. There is a test for this in UrlMountingTest.
if (target == null)
{
  // still null? check for a mount
  target = requestCodingStrategy.targetForRequest(requestParameters);

  if (target == null && requestParameters.getComponentPath() != null)
  {
    // If the target is still null and there was a component path
    // then the Page could not be located in the session
    throw new PageExpiredException(
      "Cannot find the rendered page in session [pagemap=" +
        requestParameters.getPageMapName() + ",componentPath=" +
        requestParameters.getComponentPath() + ",versionNumber=" +
        requestParameters.getVersionNumber() + "]");
  }
}

> > -----Original Message-----
> > From: Dale Ogilvie [mailto:Dale_Ogilvie@trimble.com]
> > Sent: Wednesday, 30 May 2012 9:52 a.m.
> > To: users@wicket.apache.org
> > Subject: Specified expiration page not being shown
> >
> > Hi,
> >
> > This is for wicket 1.4.20.
> >
> > In our WebApplication subclass we have used:
> >
> >
getApplicationSettings().setPageExpiredErrorPage(MyExpiredPage.class);
> >
> > However after session has expired on one of our pages, if I submit
the
> (fairly
> > complex) form, the form error message is shown. By this I mean that
> page
> > component validation fires and validation of an object from session
> (now
> > defunct) fails and the page is redrawn with an error message in the
> feedback
> > panel. The expired page IS displayed if an ajax backed combo is used
> on the
> > same form, only form submission avoids the expiry page.
> >
> > Why might it be that our MyExpiredPage is not being shown in the
form
> > submission case? We want our expired page to be displayed
> consistently.
> >
> > Thanks for any suggestions as to where to look for the issue.
> >
> > Dale
> >
> >
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org


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