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.
问题在标题中:是否<jsp:forward>或RequestDispatcher.forward使用 GET 或 POST 来做它的事情?
<jsp:forward>
RequestDispatcher.forward
如果它使用一个,我可以一直计算它是那个,还是会因服务器而异?
谢谢你们!
两者都不; 它直接在您的容器中查找 servlet 类,然后调用调度程序。
调度程序将检查请求的类型并调用适当的方法。因此,如果原始请求是POST,doPost()将被调用。
POST
doPost()