I'm not sure whether this topic should be posted here or in JSP forum but feel this is the right place.
I have a set of JSP pages which take user input and update in the database through servlets. After the user inserts the data successfully, he should be given an option whether he would like to insert another record to the same table. How can I do this in the same JSP page(remember that the data is populated through servlets)? Suppose the data is inserted successfully, I should be able to display a message that data is inserted successfully on the same JSP page and then it should also contain 2 options(probably 2 buttons), "Yes" -if he wishes to insert another record to the same table and "No" -if he is done with record insertion and redirect him to another page.
How can I insert buttons in servlet program since these buttons should be displayed only after successful record insertions. Is there any way out for this?
[ January 02, 2009: Message edited by: Bear Bibeault ]
This is what I have done, but this is not what I want.
There are 10 JSP pages from which user can enter data into 10 tables of the database. Once the data is submitted he is directed to a HTML page where he has 2 options along with the note that data is submitted successfully. 1)YES-if he wishes to enter data into the same table through page(same) which he entered previously.2) NO-if he is done with entering data into the database.
Now my problem is if he clicks on YES I should be able to direct him back to the same page. Since I have around 10 different pages, how can I get back to the same page? I mean, is there any way to dynamically get back to the same page from which he entered the data previously? Another option could be without redirecting to a HTML page but displaying the message on the same JSP page and giving him an option of selecting YES or NO. How can I do this?
Originally posted by Swapna Gouri Kalanidhi:
I mean, is there any way to dynamically get back to the same page from which he entered the data previously? Another option could be without redirecting to a HTML page but displaying the message on the same JSP page and giving him an option of selecting YES or NO. How can I do this?
Bear already mentioned in his post . there are two things help you
1.RequestDispatcher 2.sendRedirect (Thik about this )