This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Suppose I have a basic registration page on which the customer needs to enter such info: email: password: password: first name: last name: Suppose, after the customer hits the "submit" button, my servlet finds that the 2 passwords he/she has entered are not the same, then we return to the same registration page. Now, here is the problem. After we return to the same registration page, the data the customer has entered are all lost. He/she has to enter his email, first name, last name again! My question is: how can we memorize the user input so that when we return to the same registration page, we restore everything the customer has entered except the password? Can I do it like this? First name <INPUT TYPE="TEXT" NAME="firstname" <% if ( request.getParameter("firstname") != null) %> VALUE = <%= request.getParameter("firstname") %> ><BR> Last name <INPUT TYPE="TEXT" NAME="lastname" <% if ( request.getParameter("lastname") != null) %> VALUE = <%= request.getParameter("lastname") %> ><BR> I tried this, but it did not work nicely. Or do we have any other approach to this problem? I don't know if mine is right. It would be nice if you guys can paste a snippet of your sample code. I believe this many of you have such experiences. Thanks. Gene [ March 16, 2002: Message edited by: Gene Chao ]