You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by shimin_q <sm...@hotmail.com> on 2013/10/02 19:28:46 UTC

continueToOriginalDestination issue

Hello,

My homepage URL is "http://<server ip>/awol", and it is linked to
MainPage.html and MainPage.java.  I also have a HomePage.html/HomePage.java
that is essentially a login page and contains a LoginForm. 

	public Class<? extends Page> getHomePage() {
		return MainPage.class;
	}

	@Override
	protected Class<? extends WebPage> getSignInPageClass() {
		return HomePage.class;
	}

 I use continueToOriginalDestination() once LoginForm submitted
username/password and was authenticated:

	protected void onSubmit() {
		Login login = getModelObject();

		AuthenticatedWebSession session = AuthenticatedWebSession.get();
		if (session.authenticate(login.getUsername(), login.getPassword())) {
			logger.debug("authentication successful");
			this.continueToOriginalDestination();
  		}
		else {
			error("Invalid credentials");
		}
	}

I am expecting that continueToOriginalDestination would take me to the
MainPage after user successfully logged in, but intermittently,
continueToOriginalDestination() just stays on the HomePage (with the
LoginForm) even after the user name/password is authenticated.

What could be the issue?  Please help!!

Thanks!!



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/continueToOriginalDestination-issue-tp4661654.html
Sent from the Users forum 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: continueToOriginalDestination issue

Posted by shimin_q <sm...@hotmail.com>.
Here is the flow of my app:

My Application class sets the home page to be MainPage:

>         public Class<? extends Page> getHomePage() {
>                 return MainPage.class;
>         }
>
>         @Override
>         protected Class<? extends WebPage> getSignInPageClass() {
>                 return HomePage.class;
>         }
> 

So whenever I type the following URL

"http://<my server ip>/awol"

(
/awol is defined in apache httpd conf to be the location for my app: 
<Location "/awol">
    ProxyPass ajp://localhost:8010/awol
    ProxyPassReverse ajp://localhost:8010/awol
</Location>
)


it goes to my MainPage which is specified as the application's home page. 
And it is intercepted by the HomePage (which contains LoginForm).  The
intermittent problem for me is it appears the
continueToOriginalDestination() does not take me to MainPage after
authentication is successful.

Hope it clarifies.  Any ideas?

Thanks!



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/continueToOriginalDestination-issue-tp4661654p4661657.html
Sent from the Users forum 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: continueToOriginalDestination issue

Posted by Francois Meillet <fr...@gmail.com>.
Hi,

How user arrives to the HomePage.class ?
By the security layer or by a link ?
If it's by a link, continueToOriginalDestination will send the user to the original destination, which is HomePage.class.

François 




Le 2 oct. 2013 à 19:28, shimin_q <sm...@hotmail.com> a écrit :

> Hello,
> 
> My homepage URL is "http://<server ip>/awol", and it is linked to
> MainPage.html and MainPage.java.  I also have a HomePage.html/HomePage.java
> that is essentially a login page and contains a LoginForm. 
> 
> 	public Class<? extends Page> getHomePage() {
> 		return MainPage.class;
> 	}
> 
> 	@Override
> 	protected Class<? extends WebPage> getSignInPageClass() {
> 		return HomePage.class;
> 	}
> 
> I use continueToOriginalDestination() once LoginForm submitted
> username/password and was authenticated:
> 
> 	protected void onSubmit() {
> 		Login login = getModelObject();
> 
> 		AuthenticatedWebSession session = AuthenticatedWebSession.get();
> 		if (session.authenticate(login.getUsername(), login.getPassword())) {
> 			logger.debug("authentication successful");
> 			this.continueToOriginalDestination();
>  		}
> 		else {
> 			error("Invalid credentials");
> 		}
> 	}
> 
> I am expecting that continueToOriginalDestination would take me to the
> MainPage after user successfully logged in, but intermittently,
> continueToOriginalDestination() just stays on the HomePage (with the
> LoginForm) even after the user name/password is authenticated.
> 
> What could be the issue?  Please help!!
> 
> Thanks!!
> 
> 
> 
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/continueToOriginalDestination-issue-tp4661654.html
> Sent from the Users forum 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: continueToOriginalDestination issue

Posted by Martin Grigorov <mg...@apache.org>.
On Wed, Oct 2, 2013 at 8:30 PM, shimin_q <sm...@hotmail.com> wrote:

> Hi Martin,
>
> No, I did not use that.
>
> My understanding is that the URL ("http://<my server ip>/awol") takes me
> to
> my app's home page (MainPage.class), but is intercepted by the login page
>

define "is intercepted"
what logic does the redirect ?


> (HomePage.class in my case).  After login is successful, the
> continueToOriginalDestination() SOMETIMES does not seem to continue on to
> MainPage.
>
> I am not sure how the interception happened and why sometimes
> continueToOriginalDestination() does not continue on.  I am really new to
> wicket...
>
> Could you please let me know what caused this intermittent problem?
>

continueToOriginalDestination() would work only
if RestartResponseAtInterceptPageException is thrown before


>
> Thanks,
> Shi-Min
>
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/continueToOriginalDestination-issue-tp4661654p4661658.html
> Sent from the Users forum 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: continueToOriginalDestination issue

Posted by shimin_q <sm...@hotmail.com>.
Hi Martin, 

No, I did not use that.  

My understanding is that the URL ("http://<my server ip>/awol") takes me to
my app's home page (MainPage.class), but is intercepted by the login page
(HomePage.class in my case).  After login is successful, the
continueToOriginalDestination() SOMETIMES does not seem to continue on to
MainPage.  

I am not sure how the interception happened and why sometimes
continueToOriginalDestination() does not continue on.  I am really new to
wicket...

Could you please let me know what caused this intermittent problem? 

Thanks,
Shi-Min




--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/continueToOriginalDestination-issue-tp4661654p4661658.html
Sent from the Users forum 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: continueToOriginalDestination issue

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

Do you use RestartResponseAtInterceptPageException in your authorization
strategy ?


On Wed, Oct 2, 2013 at 7:28 PM, shimin_q <sm...@hotmail.com> wrote:

> Hello,
>
> My homepage URL is "http://<server ip>/awol", and it is linked to
> MainPage.html and MainPage.java.  I also have a HomePage.html/HomePage.java
> that is essentially a login page and contains a LoginForm.
>
>         public Class<? extends Page> getHomePage() {
>                 return MainPage.class;
>         }
>
>         @Override
>         protected Class<? extends WebPage> getSignInPageClass() {
>                 return HomePage.class;
>         }
>
>  I use continueToOriginalDestination() once LoginForm submitted
> username/password and was authenticated:
>
>         protected void onSubmit() {
>                 Login login = getModelObject();
>
>                 AuthenticatedWebSession session =
> AuthenticatedWebSession.get();
>                 if (session.authenticate(login.getUsername(),
> login.getPassword())) {
>                         logger.debug("authentication successful");
>                         this.continueToOriginalDestination();
>                 }
>                 else {
>                         error("Invalid credentials");
>                 }
>         }
>
> I am expecting that continueToOriginalDestination would take me to the
> MainPage after user successfully logged in, but intermittently,
> continueToOriginalDestination() just stays on the HomePage (with the
> LoginForm) even after the user name/password is authenticated.
>
> What could be the issue?  Please help!!
>
> Thanks!!
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/continueToOriginalDestination-issue-tp4661654.html
> Sent from the Users forum 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: continueToOriginalDestination issue

Posted by Marcel Hörr <ma...@gmx.de>.
hi,

my original post was sent to smqian directly (stupid mobile email client). i suggested to use a "setResponsePage(new MainPage());" after continueToOriginalDestination. but this is rather a workaround than a solution, right?

best regards

marcel

Am 02.10.2013 um 19:28 schrieb shimin_q <sm...@hotmail.com>:

> Hello,
> 
> My homepage URL is "http://<server ip>/awol", and it is linked to
> MainPage.html and MainPage.java.  I also have a HomePage.html/HomePage.java
> that is essentially a login page and contains a LoginForm. 
> 
> 	public Class<? extends Page> getHomePage() {
> 		return MainPage.class;
> 	}
> 
> 	@Override
> 	protected Class<? extends WebPage> getSignInPageClass() {
> 		return HomePage.class;
> 	}
> 
> I use continueToOriginalDestination() once LoginForm submitted
> username/password and was authenticated:
> 
> 	protected void onSubmit() {
> 		Login login = getModelObject();
> 
> 		AuthenticatedWebSession session = AuthenticatedWebSession.get();
> 		if (session.authenticate(login.getUsername(), login.getPassword())) {
> 			logger.debug("authentication successful");
> 			this.continueToOriginalDestination();
>  		}
> 		else {
> 			error("Invalid credentials");
> 		}
> 	}
> 
> I am expecting that continueToOriginalDestination would take me to the
> MainPage after user successfully logged in, but intermittently,
> continueToOriginalDestination() just stays on the HomePage (with the
> LoginForm) even after the user name/password is authenticated.
> 
> What could be the issue?  Please help!!
> 
> Thanks!!
> 
> 
> 
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/continueToOriginalDestination-issue-tp4661654.html
> Sent from the Users forum 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: continueToOriginalDestination issue

Posted by shimin_q <sm...@hotmail.com>.
I enter URL "http://<server ip>/awol"  which should direct to my
application's home page which is set to be MainPage.class:

My Application class sets the home page to be MainPage:

        public Class<? extends Page> getHomePage() {
                 return MainPage.class;
         }

         @Override
         protected Class<? extends WebPage> getSignInPageClass() {
                return HomePage.class;
        }

I used to check continueToOriginalDestination() return code and
setResponsePage(MainPage.class) if it is false.  But
continueToOriginalDestination() no longer returns a code.  Marcel suggested
that I would just call both one after another, as the following:

continueToOriginalDestination();
setResponsePage(new MainPage());

if continueToOriginalDestination() finds the originalDestination, it will
throw an exception to go on to that originalDestination.  The
setResponsePage() won't get called.

Is this what you were suggesting by "send your user to a default home page"? 
Other than this, is my code converting a Form to a StatelessForm looking all
right?  Thanks for your help!



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/continueToOriginalDestination-issue-tp4661654p4661669.html
Sent from the Users forum 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: continueToOriginalDestination issue

Posted by Nick Pratt <nb...@gmail.com>.
Are you entering the URL of your main page or your login page?

You also have to check if there is a continue-to-destination field set and
if not you have to send your user to a default home page.

N
On Oct 2, 2013 8:18 PM, "shimin_q" <sm...@hotmail.com> wrote:

> Thanks - that sounds exactly what I observed in my case where the login
> page
> (HomePage class) gets redisplayed after I entered the user name and
> password.
>
> I am looking at some sample code with Stateless login forms, in addition to
> using StatelessForm instead Form, a bind() is called too after
> authenticate().  So I changed my LoginForm as follows (note that LoginForm
> is part of my HomePage class):
>
> public class LoginForm extends StatelessForm<Login> {
>
>         private static final Logger logger =
>                         LoggerFactory.getLogger(LoginForm.class);
>
>         private static final long serialVersionUID = 1L;
>
>         private TextField<String> username;
>         private PasswordTextField password;
>
>         public LoginForm(String id) {
>                 super(id, new CompoundPropertyModel<Login>(new Login()));
>
>                 username = new TextField<String>("username");
>                 username.setRequired(true);
>                 add(username);
>                 password = new PasswordTextField("password");
>                 add(password);
>         }
>
>         @Override
>         protected void onSubmit() {
>                 Login login = getModelObject();
>
>                 AuthenticatedWebSession session =
> AuthenticatedWebSession.get();
>                 if(session instanceof AwolAuthenticatedWebSession) {
>                         logger.debug("session is
> AwolAuthenticatedWebSession");
>                 }
>                 if (session.authenticate(login.getUsername(),
> login.getPassword())) {
>                         logger.debug("authentication successful");
>                         if (session.isTemporary()) {
>                                 logger.debug("session temporary, bind to
> permanent");
>                                 session.bind();  // according to sample
> code, this makes the temporary
> session used by the stateless login page permanent
>                         }
>
>                         this.continueToOriginalDestination();
>                 }
>                 else {
>                         error("Invalid credentials");
>                 }
>         }
>
> But this code change does not seem to work either.  The first time I log
> in,
> the session.isTemporary returns true, so it did session.bind().  But after
> continueToOriginalDestination(), it is still the login page displayed, it
> does not go on to MainPage.  If I enter username/password again, this time,
> the code seems to get a session.isTemporary returns false, and
> continueToOriginalDestination() still does not go on to MainPage.
>
> Anything else I am missing here?  Thanks for your help!
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/continueToOriginalDestination-issue-tp4661654p4661667.html
> Sent from the Users forum 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: continueToOriginalDestination issue

Posted by shimin_q <sm...@hotmail.com>.
Thanks - that sounds exactly what I observed in my case where the login page
(HomePage class) gets redisplayed after I entered the user name and
password.

I am looking at some sample code with Stateless login forms, in addition to
using StatelessForm instead Form, a bind() is called too after
authenticate().  So I changed my LoginForm as follows (note that LoginForm
is part of my HomePage class):

public class LoginForm extends StatelessForm<Login> {

	private static final Logger logger =
			LoggerFactory.getLogger(LoginForm.class);

	private static final long serialVersionUID = 1L;

	private TextField<String> username;
	private PasswordTextField password;

	public LoginForm(String id) {
		super(id, new CompoundPropertyModel<Login>(new Login()));

		username = new TextField<String>("username");
		username.setRequired(true);
		add(username);
		password = new PasswordTextField("password");
		add(password);
	}

	@Override
	protected void onSubmit() {
		Login login = getModelObject();

		AuthenticatedWebSession session = AuthenticatedWebSession.get();
		if(session instanceof AwolAuthenticatedWebSession) {
			logger.debug("session is AwolAuthenticatedWebSession");
		}
		if (session.authenticate(login.getUsername(), login.getPassword())) {
			logger.debug("authentication successful");
			if (session.isTemporary()) {
				logger.debug("session temporary, bind to permanent");
				session.bind();  // according to sample code, this makes the temporary
session used by the stateless login page permanent
			} 

			this.continueToOriginalDestination();
		}
		else {
			error("Invalid credentials");
		}
	}

But this code change does not seem to work either.  The first time I log in,
the session.isTemporary returns true, so it did session.bind().  But after
continueToOriginalDestination(), it is still the login page displayed, it
does not go on to MainPage.  If I enter username/password again, this time,
the code seems to get a session.isTemporary returns false, and
continueToOriginalDestination() still does not go on to MainPage.

Anything else I am missing here?  Thanks for your help!



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/continueToOriginalDestination-issue-tp4661654p4661667.html
Sent from the Users forum 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: continueToOriginalDestination issue

Posted by Nick Pratt <nb...@gmail.com>.
No - it the login page was redisplayed.

N
On Oct 2, 2013 6:31 PM, "shimin_q" <sm...@hotmail.com> wrote:

> Just to make sure the problem I am seeing is due to the timed out Login
> page...when you say
>
> "the original login page displayed would have timed out and the attempted
> login wont succeed."
>
> When your attempted login failed, does another page come up with some
> generic browser error message or does it stay on the login page?
>
> In my case, after I entered the username/password, it just stays on the
> login page without the "Invalid credentials" error for failed
> authentication.  That was why I suspected my authenticate() was OK, it was
> the continueToOriginalDestination() not continuing on.
>
> Thanks for the help as I try to figure this out!!
>
> Shi-Min
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/continueToOriginalDestination-issue-tp4661654p4661665.html
> Sent from the Users forum 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: continueToOriginalDestination issue

Posted by shimin_q <sm...@hotmail.com>.
Just to make sure the problem I am seeing is due to the timed out Login
page...when you say 

"the original login page displayed would have timed out and the attempted
login wont succeed."

When your attempted login failed, does another page come up with some
generic browser error message or does it stay on the login page?

In my case, after I entered the username/password, it just stays on the
login page without the "Invalid credentials" error for failed
authentication.  That was why I suspected my authenticate() was OK, it was
the continueToOriginalDestination() not continuing on.  

Thanks for the help as I try to figure this out!!

Shi-Min



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/continueToOriginalDestination-issue-tp4661654p4661665.html
Sent from the Users forum 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: continueToOriginalDestination issue

Posted by shimin_q <sm...@hotmail.com>.
OK, could it be as simple as changing the following line:

public class LoginForm extends Form<Login> 

to 

public class LoginForm extends StatelessForm<Login>

as you can see my login page (HomePage class) is really simple (only 3
components: a label, a LoginForm, a FeedbackPanel), right?

Thanks,
Shi-Min



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/continueToOriginalDestination-issue-tp4661654p4661664.html
Sent from the Users forum 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: continueToOriginalDestination issue

Posted by Nick Pratt <nb...@gmail.com>.
Any components on your Page that aren't stateless cause the Page containing
them to be Stateful- Forms are stateful by default.  Add this to your
page's onInitialize() and it will help you see what's going on.  Check out
Wicket's StatelessForm class.

@Override
protected void onInitialize()
 {
super.onInitialize();

visitChildren( new IVisitor<Component, Void>()
{
 @Override
public void component( Component component, IVisit<Void> visit )
 {
if( component.isStateless() )
 {
return;
 }

log.warn( "Not Stateless: Component: " + component.getId() + " / " +
component.getMarkupId() + " - " + component.getPageRelativePath() );
 }
} );
}



On Wed, Oct 2, 2013 at 5:05 PM, shimin_q <sm...@hotmail.com> wrote:

> This could explain the intermittent nature of the problem.  Thanks, Nick!
> Could you elaborate on what you mean by stateless login page?  Here is my
> Login page and Login Form inside it.  Could you please tell me what I need
> to change?
>
> public class HomePage extends WebPage {
>
>         public HomePage() {
>                 add(new Label("headerMessage", "OmniVista 8770 Login"));
>
>                 add(new LoginForm("form"));
>
>                 add(new FeedbackPanel("feedback"));
>         }
>
> }
>
> public class LoginForm extends Form<Login> {
>
>         private static final Logger logger =
>                         LoggerFactory.getLogger(LoginForm.class);
>
>         private static final long serialVersionUID = 1L;
>
>         private TextField<String> username;
>         private PasswordTextField password;
>
>         public LoginForm(String id) {
>                 super(id, new CompoundPropertyModel<Login>(new Login()));
>
>                 username = new TextField<String>("username");
>                 username.setRequired(true);
>                 add(username);
>                 password = new PasswordTextField("password");
>                 add(password);
>         }
>
>         @Override
>         protected void onSubmit() {
>                 Login login = getModelObject();
>
>                 AuthenticatedWebSession session =
> AuthenticatedWebSession.get();
>                 if (session.authenticate(login.getUsername(),
> login.getPassword())) {
>                         logger.debug("authentication successful");
>                         this.continueToOriginalDestination();
>                 }
>                 else {
>                         error("Invalid credentials");
>                 }
>         }
>
> }
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/continueToOriginalDestination-issue-tp4661654p4661662.html
> Sent from the Users forum 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: continueToOriginalDestination issue

Posted by shimin_q <sm...@hotmail.com>.
This could explain the intermittent nature of the problem.  Thanks, Nick! 
Could you elaborate on what you mean by stateless login page?  Here is my
Login page and Login Form inside it.  Could you please tell me what I need
to change?

public class HomePage extends WebPage {

	public HomePage() {
		add(new Label("headerMessage", "OmniVista 8770 Login"));

		add(new LoginForm("form"));

		add(new FeedbackPanel("feedback"));
	}

}

public class LoginForm extends Form<Login> {

	private static final Logger logger =
			LoggerFactory.getLogger(LoginForm.class);

	private static final long serialVersionUID = 1L;

	private TextField<String> username;
	private PasswordTextField password;

	public LoginForm(String id) {
		super(id, new CompoundPropertyModel<Login>(new Login()));

		username = new TextField<String>("username");
		username.setRequired(true);
		add(username);
		password = new PasswordTextField("password");
		add(password);
	}

	@Override
	protected void onSubmit() {
		Login login = getModelObject();

		AuthenticatedWebSession session = AuthenticatedWebSession.get();
		if (session.authenticate(login.getUsername(), login.getPassword())) {
			logger.debug("authentication successful");
			this.continueToOriginalDestination();
		}
		else {
			error("Invalid credentials");
		}
	}

}



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/continueToOriginalDestination-issue-tp4661654p4661662.html
Sent from the Users forum 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: continueToOriginalDestination issue

Posted by Nick Pratt <nb...@gmail.com>.
One thing to check is if your login page is stateless.  If its not, and you
attempt to login using your login page some time after your initially
loaded the page in the browser, then the original login page displayed
would have timed out and the attempted login wont succeed.  Ive seen this
behavior a couple of times now (after which we fix the Login Page and make
it stateless)


On Wed, Oct 2, 2013 at 1:28 PM, shimin_q <sm...@hotmail.com> wrote:

> Hello,
>
> My homepage URL is "http://<server ip>/awol", and it is linked to
> MainPage.html and MainPage.java.  I also have a HomePage.html/HomePage.java
> that is essentially a login page and contains a LoginForm.
>
>         public Class<? extends Page> getHomePage() {
>                 return MainPage.class;
>         }
>
>         @Override
>         protected Class<? extends WebPage> getSignInPageClass() {
>                 return HomePage.class;
>         }
>
>  I use continueToOriginalDestination() once LoginForm submitted
> username/password and was authenticated:
>
>         protected void onSubmit() {
>                 Login login = getModelObject();
>
>                 AuthenticatedWebSession session =
> AuthenticatedWebSession.get();
>                 if (session.authenticate(login.getUsername(),
> login.getPassword())) {
>                         logger.debug("authentication successful");
>                         this.continueToOriginalDestination();
>                 }
>                 else {
>                         error("Invalid credentials");
>                 }
>         }
>
> I am expecting that continueToOriginalDestination would take me to the
> MainPage after user successfully logged in, but intermittently,
> continueToOriginalDestination() just stays on the HomePage (with the
> LoginForm) even after the user name/password is authenticated.
>
> What could be the issue?  Please help!!
>
> Thanks!!
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/continueToOriginalDestination-issue-tp4661654.html
> Sent from the Users forum 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
>
>