One way to do it is to use two beans, first for the login and scond for your
info page.
your login page is the start page where you would create the bean instance
and make it a session scoped.
Import this bean instance in your second page, if it is not in session then
send it to the login jsp page.
while sending him to the login page attach the url of the current page as a
part of query string so that when he successfully logs in, he can come back
to the same page where he was. This is all done when the session expires
before the user can see the second page

If the login session expires while he is entering values in the current
page, then you can save all these values in the second page's bean before
forwarding him to the login page, when the user comes back to the same page
after logging in, then get the bean's properties and populate the form
fields. ( You can add stuff to query string to check your state, whether you
are coming back to the same page after typing some stuff or it is a fresh
start.

Hope this helps.

- khaitan

----- Original Message -----
From: Rupesh Choubey <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 29, 1999 11:02 AM
Subject: session timeout...need to login (sometimes) and get back to same
page


> jsp gurus..please help........
>
> the issue i am dealing with (sounds similar to what many have dealt with)
is
> that if a user is on a certain page and the session times out.....then we
> need to send him ot the login page and after a successful login, we need
to
> redirect the user to the page he had submitted WITH the information he had
> possibly typed.........
>
> heres some thoughts i had.........
> (we use our HTML to talk to servlets which talk to EJBs / Java Beans) and
> then redirect to other JSPs
>
> on each page
> 1. if the servlet gets a request, save all the session and request
> information locally
> 2. call a login validator (servlet?????) passing it a destination jsp in
the
> SESSION variable...........
> 3. login validator checks session if the user is logged in
> 4. if yes, then it redirects to jsp directly
> 5. if no, it calls the login.jsp
> 6. login.jsp tries logging in using the SAME login validator
> 7. if login fails, error page is returned,
> 8. if login succeeds, the destination jsp is used to redirect to the jsp
>
> how does this sound? i am not too sure of the design or even whether it
will
> work......i would really appreciate if you shared your thoughts and if you
> have any code samples, it would be awesome...
>
> thanks,
> rupesh.
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> FAQs on JSP can be found at:
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to