Code to put on servlet to go back to page

I was wondering how/what code to put on a servlet so that the page before calling the servlet is shown. I have a page when I submit it, it calls my servlet then the servlet saves to a database based on the parameters of the request. When that is done, I want to automatically go back to that page, with all fields now blank.
Thank you

Yes. Thanks for your reply. Another question though. I tried both options and why is it when I use the response.sendRedirect() all I have to put is the actual page. When I forward using the RequestDispatcher, I have to include the folder where the page is stored.
/FolderOne
'--> somepage.jsp
Thats the hierachy.
Also the url mapping for my servlet is FolderOne/someservlet
BTW. I wrote mine like this on my servlet
this.getServletConfig().getServletContext().getRequestDispatcher("/FolderOne/somepage.jsp").forward(req, res);Why the difference?

Similar Messages

Maybe you are looking for