Reputation: 1679
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.
Upvotes: 1
Views: 4492
Reputation: 5086
Assuming HTTP servlets intended for web-based use, I would recommend a ServletResponse.sendRedirect(...)
to have the client request service from BarServlet
in order to convey some insight into the server's view on things, and to avoid unintended re-POSTs, and so on.
Upvotes: 4