ok thanks for quick replay,

I think there should be more info in javadoc about the intension fo the
exception and continueToOriginalDestination method

pozdrawiam
Paweł Kamiński

[email protected]
[email protected]
______________________


On 21 November 2011 03:40, Bertrand Guay-Paquet <[email protected]>wrote:

> 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
>> RestartResponseAtInterceptPage**Exception 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 RestartResponseAtInterceptPage**Exception(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
>> RestartResponseAtInterceptPage**Exception.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 RestartResponseAtInterceptPage**Exception is used with
>> accessing
>> protected resources with IUnauthorizedComponentInstanti**ationListener
>> 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: 
> users-unsubscribe@wicket.**apache.org<[email protected]>
> For additional commands, e-mail: [email protected]
>
>

Reply via email to