Hi Jeremy,

Thanks for your reply. Adding a session.bind() solved the issue.

Neil

On Wed, May 20, 2009 at 12:03 PM, Jeremy Thomerson <
[email protected]> wrote:

> If you're in the stateless form's onsubmit and you redirect to a
> stateless page, you may need to call session.bind so that it knows
> that you need the session to be persistent.
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>
>
>
>
> On Wed, May 20, 2009 at 10:50 AM, Neil Curzon <[email protected]>
> wrote:
> > Hi all,
> >
> > I'm having an issue with sitting on the login page for a while before
> > entering credentials. You get a Page Expired if you submit after waiting
> too
> > long, and I think this will confuse my users. Especially since I was
> > planning on setting my custom expired page to the Login.
> >
> > Some googling lead me to StatelessForm which sounded like it would solve
> my
> > problem. However, after I use it, I find I can actually never log in
> > successfully. For now, I just set a boolean in the session if the
> > credentials match. My debugging output indicates that the boolean is
> being
> > set to true. Here's the form's onSubmit.
> >
> >        @Override
> >        protected void onSubmit() {
> >            if (loginIsValid()) {
> >                System.out.println("Yep, I'm setting logged in to true");
> >                MySession session = MySession.get();
> >                session.setLoggedIn(true);
> >                setRedirect(true);
> >                setResponsePage(AdminIndex.class);
> >            } else {
> >                System.out.println("NO GOOD");
> >                error("Invalid user and/or password");
> >            }
> >        }
> >
> > However, I also put a debug message before my newSession method in my
> > Application, and it seems that a new session is created for every
> request,
> > including the redirect after successful login. This results in my base
> page
> > class detecting that the user isn't logged in and redirecting back to the
> > Login page. Everything works fine if I change the StatelessForm back to
> > Form.
> >
> > Is there some way I could fix this StatelessForm? Or is there some better
> > way to get the login form to never give a page expired?
> >
> > Thanks
> > Neil
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to