I need to forward from my FooServlet doPost method to BarServlet doGet method. Is there a way to solve this?
Currently I’m calling the doGet method from my doPost but I’m sure that this isn’t the best practice.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Assuming HTTP servlets intended for web-based use, I would recommend a
ServletResponse.sendRedirect(...)to have the client request service fromBarServletin order to convey some insight into the server’s view on things, and to avoid unintended re-POSTs, and so on.