开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜