You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Tim Moose <hu...@gmail.com> on 2009/05/27 00:32:20 UTC
Expired sign in link after signing out
Hi,
This seems like a FAQ but I couldn't find it. All of my pages have a
common header with sign in / sign out links. When the user clicks the
sign in link, I want to display the sign in page and then return to
the previous page after the user signs in. My sign in link looks like
this:
add(new Link("signin") {
@Override
public void onClick() {
throw new RestartResponseAtInterceptPageException(SignInPage.class);
}
...
}
This works fine unless the user has just signed out, at which point
the link leads to an expired page error. My sign out page constructor
does the following:
getSession().invalidate();
setResponsePage(pageClass);
I think I get what's wrong with this, but none of the variations I've
tried work. So how can I get the sign in link to work after signing
out?
Thanks,
Tim
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Expired sign in link after signing out
Posted by Tim Moose <hu...@gmail.com>.
Same error in 1.3.6. Worked in 1.4-rc4. Thanks for the suggestion.
Tim
Jeremy Thomerson-5 wrote:
>
> If you're on 1.3.2 can you try upgrading to at least the latest 1.3.X
> release (or even better, 1.4-rc4) to see if that doesn't fix it?
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>
>
>
>
> On Wed, May 27, 2009 at 7:34 AM, Tim Moose <hu...@gmail.com> wrote:
>>
>>>add(new BookmarkablePageLink("signin", SigninPage.class));
>>
>> That is one thing I tried, but it didn't work for me. I am using
>> org.apache.wicket.authentication.panel.SignInPanel and with the above
>> bookmarkable link, I get the following exception in onSignInSucceeded:
>>
>> java.lang.IllegalArgumentException: wrong number of arguments
>> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>> Method)
>> at
>> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
>> at
>> java.lang.reflect.Constructor.newInstance(Constructor.java:494)
>> at
>> org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:149)
>> at
>> org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:88)
>> at org.apache.wicket.authentication.panel.SignInPanel
>> onSignInSucceeded(SignInPage.java:65)
>>
>> I'm not able to spot the problem from the 1.3.2 source code:
>>
>> protected void onSignInSucceeded()
>> {
>> // If login has been called because the user was not yet
>> // logged in, than continue to the original destination,
>> // otherwise to the Home page
>> if (!continueToOriginalDestination())
>> {
>>
>> setResponsePage(getApplication().getSessionSettings().getPageFactory().newPage(
>> getApplication().getHomePage(),
>> (PageParameters)null));
>> }
>> }
>>
>> I did verify that getHomePage() is correctly returning my home page class
>> and my home page constructors look like this:
>>
>> public Index() {
>> this(null);
>> }
>>
>> public Index(final PageParameters parameters) {
>> super(parameters);
>> }
>>
>> Any idea what I'm doing wrong?
>>
>> Thanks,
>>
>> Tim
>> --
>> View this message in context:
>> http://www.nabble.com/Expired-sign-in-link-after-signing-out-tp23732685p23741603.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>
>
--
View this message in context: http://www.nabble.com/Expired-sign-in-link-after-signing-out-tp23732685p23773978.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Expired sign in link after signing out
Posted by Jeremy Thomerson <je...@wickettraining.com>.
If you're on 1.3.2 can you try upgrading to at least the latest 1.3.X
release (or even better, 1.4-rc4) to see if that doesn't fix it?
--
Jeremy Thomerson
http://www.wickettraining.com
On Wed, May 27, 2009 at 7:34 AM, Tim Moose <hu...@gmail.com> wrote:
>
>>add(new BookmarkablePageLink("signin", SigninPage.class));
>
> That is one thing I tried, but it didn't work for me. I am using
> org.apache.wicket.authentication.panel.SignInPanel and with the above
> bookmarkable link, I get the following exception in onSignInSucceeded:
>
> java.lang.IllegalArgumentException: wrong number of arguments
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
> at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
> at
> org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:149)
> at
> org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:88)
> at org.apache.wicket.authentication.panel.SignInPanel
> onSignInSucceeded(SignInPage.java:65)
>
> I'm not able to spot the problem from the 1.3.2 source code:
>
> protected void onSignInSucceeded()
> {
> // If login has been called because the user was not yet
> // logged in, than continue to the original destination,
> // otherwise to the Home page
> if (!continueToOriginalDestination())
> {
>
> setResponsePage(getApplication().getSessionSettings().getPageFactory().newPage(
> getApplication().getHomePage(), (PageParameters)null));
> }
> }
>
> I did verify that getHomePage() is correctly returning my home page class
> and my home page constructors look like this:
>
> public Index() {
> this(null);
> }
>
> public Index(final PageParameters parameters) {
> super(parameters);
> }
>
> Any idea what I'm doing wrong?
>
> Thanks,
>
> Tim
> --
> View this message in context: http://www.nabble.com/Expired-sign-in-link-after-signing-out-tp23732685p23741603.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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
Re: Expired sign in link after signing out
Posted by Tim Moose <hu...@gmail.com>.
>add(new BookmarkablePageLink("signin", SigninPage.class));
That is one thing I tried, but it didn't work for me. I am using
org.apache.wicket.authentication.panel.SignInPanel and with the above
bookmarkable link, I get the following exception in onSignInSucceeded:
java.lang.IllegalArgumentException: wrong number of arguments
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at
org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:149)
at
org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:88)
at org.apache.wicket.authentication.panel.SignInPanel
onSignInSucceeded(SignInPage.java:65)
I'm not able to spot the problem from the 1.3.2 source code:
protected void onSignInSucceeded()
{
// If login has been called because the user was not yet
// logged in, than continue to the original destination,
// otherwise to the Home page
if (!continueToOriginalDestination())
{
setResponsePage(getApplication().getSessionSettings().getPageFactory().newPage(
getApplication().getHomePage(), (PageParameters)null));
}
}
I did verify that getHomePage() is correctly returning my home page class
and my home page constructors look like this:
public Index() {
this(null);
}
public Index(final PageParameters parameters) {
super(parameters);
}
Any idea what I'm doing wrong?
Thanks,
Tim
--
View this message in context: http://www.nabble.com/Expired-sign-in-link-after-signing-out-tp23732685p23741603.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Expired sign in link after signing out
Posted by Ryan Gravener <ry...@ryangravener.com>.
add(new BookmarkablePageLink("signin", SigninPage.class));
Ryan Gravener
http://isithotinhereorisitjust.me | http://twitter.com/ryangravener
On Tue, May 26, 2009 at 6:32 PM, Tim Moose <hu...@gmail.com> wrote:
> Hi,
>
> This seems like a FAQ but I couldn't find it. All of my pages have a
> common header with sign in / sign out links. When the user clicks the
> sign in link, I want to display the sign in page and then return to
> the previous page after the user signs in. My sign in link looks like
> this:
>
> add(new Link("signin") {
> @Override
> public void onClick() {
> throw new
> RestartResponseAtInterceptPageException(SignInPage.class);
> }
> ...
> }
>
> This works fine unless the user has just signed out, at which point
> the link leads to an expired page error. My sign out page constructor
> does the following:
>
> getSession().invalidate();
> setResponsePage(pageClass);
>
> I think I get what's wrong with this, but none of the variations I've
> tried work. So how can I get the sign in link to work after signing
> out?
>
> Thanks,
> Tim
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>