Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要从我的 FooServlet doPost方法转发到 BarServlet doGet方法。有没有办法解决这个问题?
目前我正在从我的 doPost 调用 doGet 方法,但我确信这不是最佳实践。
假设 HTTP servlet 用于基于 Web 的使用,我建议使用ServletResponse.sendRedirect(...)客户端请求服务BarServlet,以便传达对服务器对事物的看法的一些洞察力,并避免意外的重新发布,等等。
ServletResponse.sendRedirect(...)
BarServlet