Thursday, August 7, 2003 09:36 AM
After you have added the data to the database, you should redirect (not forward) the client to another page that just displays the data. UserForm.jsp posts to UserPost.jsp which adds the data to the database and then calls response.redirect() to sent the user to UserView.jsp. UserPost.jsp should not write any output to the response.
If you can't find out which record has just been added, UserView.jsp could just list the last 10 inserts or something, or maybe even just say "thank you for your input".
What database are you using ? MySQL, for example, allows you to do "SELECT last_insert_id()" to get the autoincrement ID of the last record inserted, and you can then use that to display the inserted data in UserView.jsp.
Hope this helps.