Hi,

If you need a reference to the referrer, you could simply store the current page's PageReference which is available with getPage().getPageReference(). Then use setResponsePage(SignInPage.class) to go to the login page. PageReference is a serializable id that can later be used in your login form submit method with setResponsePage(pageRef.getPage());

There is no need for using the exception mechanism for this. Storing in the session means that multiple tabs won't work. You might want to send the pageRef directly as a parameter to the SignInPage constructor instead, but it will make your page stateful.

Bertrand

On 20/11/2011 5:59 PM, kamiseq wrote:
hej,
I'm just looking form clarification on
RestartResponseAtInterceptPageException and continueToOriginalDestination().

On every page I have a log-in link, and after log in I should be redirected
back to the original destination. I use oauth api that requires that I
redirect user to external url and then user will be redirected back to my
service.
In handler for onClick i have

new RestartResponseAtInterceptPageException(MainPage.class);
throw new RedirectToUrlException(url);

intercept page does not matter as I do not throw the exception I just save
InterceptData in session so next time I call
continueToOriginalDestination() this data will be used.

the only problem is that while saving (from
RestartResponseAtInterceptPageException.InterceptData)

Request request = RequestCycle.get().getRequest();
data.originalUrl = request.getOriginalUrl();

originalUrl point to onClick callback and then app loops.

I could of course save page instance and then redirect to it, but this is
reinventing the mechanism that wicket already provides, isn't it?
I know that RestartResponseAtInterceptPageException is used with accessing
protected resources with IUnauthorizedComponentInstantiationListener and
then url always points to page and not to handler.

thanks for any comment on that

pozdrawiam
Paweł Kamiński

[email protected]
[email protected]
______________________


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to