Hey Mala:
Maintain session state by using HttpSession objects. In your case, if page 1
posts to a servlet, its doPost() could have something like this:
HttpSession session = request.getSession(true);
//do some work here
session.setAttribute("someImportantVal", v);
//do more work
//pass control to page 2
Then when you are ready to get back to page 1, something like this can be done:
HttpSession session = request.getSession(false); //"false" here is important:
read the API
ImportantValueClass savedValue =
(ImportantValueClass)session.getAttribute("someImportantVal");
Now do what you want with savedValue.
These archives have more code snippets: search under "HttpSession" or
"session". (And of course read the API! :-)
Geeta
Mala GP wrote:
> Hello Group,
>
> I have a servlet which displays a html page and on
> the click of a button in the page the control is
> transferred to another page. When he is done with the
> second page and clicks on submit, the control should
> go back to the first page and I want to populate some
> of the fields with the values seleceted in the
> secondpage . But when I go back the servlet has to
> regenrate the first page and all the inputs that were
> entered before calling the second page are lost. How
> do I get back the values of the first page as it was
> before the second page was called? Is there is a way
> to maintain states in the servlets?
> Please help me this is very urgent..
>
> Thanks
> mala
>
> __________________________________________________
> Do You Yahoo!?
> Send instant messages & get email alerts with Yahoo! Messenger.
> http://im.yahoo.com/
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html