This is what i plan to acheive. A page with a form (eg.textfield). When the user enters his name into the textfield and clicks submit. He is brought to a page which shows his name with two buttons. One button is confirm. The second button is edit.
1) The confirm button will then save the data into a mysql database.
2) The edit button brings the user back to the form page, where the user can then make changes. The data entered into the textfield, and radio buttons must still remain there.
How do i go about executing something like the above.
one way would be to store the value from your textfield in a session object with session.setAttribute("value", obj) then your servlet can direct it to result.jsp, edit.jsp etc. finally with "Save" button, your servlet can save it to the database.
Who dares, wins! (SAS motto)
Joined: Jun 02, 2006
OK, i 'm able to do that. Using sessions to hold the variables. How do i ensure that when i go back to the edit page, the textfields and radiobuttons still hold the session values and are not empty. As i dont want the user to type all over again but to just edit maybe a spelling mistake.
it's the same way. If you can create a javaBean to hold the variables you need to keep track off- like the name, radio button question, select options etc. Then instead of storing individual strings like "name" etc in session bean, you store the whole javaBean in the session.
Then use a branching statement to determine which one gets selected
[ June 15, 2006: Message edited by: kwame Iwegbue ]