wood burning stoves 2.0*
The moose likes Servlets and the fly likes Message to show database update Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Message to show database update" Watch "Message to show database update" New topic
Author

Message to show database update

Anjali Ajwani
Greenhorn

Joined: Jan 18, 2001
Posts: 16
I have a form in a JSP page which accepts several fields from the user. After entering these fields the user can select either "Add this vendor" or "Add Location for this vendor". If "Add this Vendor" is selected, the controller servlet will insert all these fields into the database.
Once the values are inserted in the database(executeUpdate() is done), the user should see a message saying "Insert successful" and also come back to this first JSP, so that he can enter "Location" now. How do I achieve this?
Sam Dalton
Author
Ranch Hand

Joined: Jul 26, 2001
Posts: 170
Have your servlet redirect (via the requestdispatcher) to the success (or failure) page. The page can have a meta tag that forwards onto the first JSP page after a predefined period of time.
S


<a href="http://www.samjdalton.com" target="_blank" rel="nofollow">Sam Dalton</a>,<br />Co-author of [http://www.amazon.com/exec/obidos/tg/detail/-/1590592255/qid=1068633302//ref=sr_8_xs_ap_i0_xgl14/104-4904002-9274339?v=glance&s=books&n=507846]Professional JSP 2.0[/URL] (October 2003)<br />Co-author of <a href="http://www.amazon.com/exec/obidos/ASIN/1861007701/ref=ase_electricporkchop" target="_blank" rel="nofollow">Professional SCWCD Certification</a><br />Co-author of <a href="http://www.amazon.com/exec/obidos/ASIN/186100561X/ref=ase_electricporkchop" target="_blank" rel="nofollow">Professional Java Servlets 2.3</a>
Anjali Ajwani
Greenhorn

Joined: Jan 18, 2001
Posts: 16
Hi,
The first part(requestdispatcher), I had done yesterday. How do I do the second one....sending the control to JSP after lapse of some seconds? Which package can I find this in?
Thanks,
 
 
subject: Message to show database update