Hello all,

Maybe it's just late but I'm pretty confused by how the following code snippets are supposed to work and the differences between them:
  1. redirectToInterceptPage(new Login(getPage()));
  2. throw new RestartResponseAtInterceptPageException(new Login(getPage()));
  3. setResponsePage(previousPage);
  4. continueToOriginalDestination();
What I'm trying to do is create a Login link on every page that will return the user back to their current page on a successful login.  I've tried various combinations of all of the above snippets, but can't seem to get it to work correctly.  My last best guess was this:

onClick() method of Link in LoginPanel:
        public void onClick()
        {
            redirectToInterceptPage(new Login(getPage()));
        }

onSubmit() method of SignInForm on LoginPage:
        protected final void onSubmit()
        {
            super.onSubmit();
            ...
            if ( ... /* login was successful */)
            {
                if (previousPage != null)
                    setResponsePage(previousPage);
                if (!continueToOriginalDestination())
                    setResponsePage(getApplication().getHomePage());
            }
            else
            {
                error("Unable to login.");
            }
        }

This leaves the user on the LoginPage when they successfully login.  I'm stumped: can anyone offer some advice or point me to where the intricacies of all of those code snippets is explained?

Thanks!
Karl

--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to