Dispatcher forward method from POST to GET
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 p开发者_运维百科ractice.
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.
精彩评论