Forget everything I say :-D and look code below:

For example:

*SomePage:*
add(new Link("signInLink") {
    void onClick() {
        redirectToInterceptPage(new SignInPage());
    }
});

*SignInPage:*
add(new SignInForm("signInForm") {
    void onSubmit() {
        ...
        continueToOriginalPage();
    }
});

Above is fine and all works, but when you leave the page to long then the
signInLink cannot be click anymore, they said page is expired. Actually I
was wrong about the session thing, the page expired because of I just
restart the server. So actually no problem even we leave the page in a long
time except we restart the server.


*Other solution*
Then I was thinking to use mount a path "signIn" to a SignInPage.class and
to do that I need to use BookmarkablePageLink. Even we restart the server,
the link should wor

*SomePage:*
add(new BookmarkablePageLink("signInLink", SignInPage.class));

but there is no way I can invoke redirectToInterceptPage or throw new
RestartResponseAtInterceptPageException(new SignInPage(this)) ? where should
I put those code?


Regards,
uudashr

2009/8/30 Major Péter <[email protected]>

> Hi,
>
> Solution 1.:
> you could try throw new RestartResponseAtInterceptPageException(new
> SignInPage()), maybe it's working without session (I guess it won't)
>
> Solution 2.:
> You could create a constructor which will accept a Page as a parameter, so
> you can do such thing:
> throw new RestartResponseException(new SignInPage(this));
> and use that parameter when the login was successful.
>
> Regards,
> Peter
>
> uud ashr írta:
>
>  Hi all,
>> Need help here, another wicket question.
>>
>> The case is I have User Panel on all pages in my website. User Panel
>> contains SignIn link (if user not logged in yet), SignOut link and label
>> of
>> the logged user (if the user has logged in).
>>
>> Solution 1.
>> On SignIn link, I'm using redirectToInterceptPage(new SignInPage()) so
>> when
>> sign in succeed I can call continueToOriginalDestination() so I can go to
>> the previous page (the returning page). I don't know this is the best
>> solution or not, but it's works fine until I found that SignIn link
>> component work using session and when session timeout the link won't work
>> anymore. So it only work if it was fresh page.
>>
>> Solution 2
>> I need (maybe) to get referer url. Is there anyway to get referer url?
>>
>> Or is the other solution?
>> Help would be appreciate.
>>
>>
>> Thanks guys,
>> uudashr
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to