This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
I have made one html which takes data to a servlet which finally inserts it into database. But if any error occurs in the servlet(flow goes within the catch statement), then browser should automatically go back one page to html where form is there with all values entered in the form(same function which we do by pressing browser's back button.). firstname.lastname@example.org
I'm assuming you get exceptions when a user enters incorrect information (text where you expect an integer perhaps?). The proper thing to do is to catch the exception and use the information the user supplied to build a new page with some extra information in it. If you really want to redirect a user (the user will lose the information he/she has entered!), it might be possible to get the "referrer" from the HTTP request header and do a response.sendRedirect on that. However, this will probably just send them back to an empty form without any information on what happened. (plus, you don't always get a referrer from the browser) Hope this helps, Thomas