回答
的servlet
具有處理客戶端的請求兩個重要的方法:
1. doPost: in general handles requests coming from forms with post method.
2. doGet: handled requests coming from get method.
現在,ProcessRequest
方法,是任何其他方法,你可以用於未綁定的代碼(覆蓋)任何東西。
從上面的方法調用它不會使其中的代碼複雜化,因此請求在其中被處理。
因此您可以使用ProcessRequest
來處理您的請求當且僅當它是從上述方法之一調用。
噢。 :)現在我完全理解它。非常感謝你。這個網站真的有幫助。 –
唯一ProcessRequest我能找到,示例包括本
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
和
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
所以,當你調用它,它被稱爲。
那意味着我可以每次都重載porcessRequest方法? –
執行。 ProcessRequest不在Servlet中,所以你不能覆蓋它。 –
- 1. 的ProcessRequest(HttpContextBase)方法
- 2. ASPX中的重複方法'ProcessRequest'
- 3. 在WCF中訪問HttpContext RequestInterceptor ProcessRequest方法
- 4. ProcessRequest Vs AuthenticateRequest
- 5. 在SipListener中的Jain Sip processRequest方法不叫
- 6. 爲什麼在Servlet中使用processRequest方法?
- 7. ASP.Net HttpHandler ProcessRequest()發射兩次
- 8. 消費Json數據ProcessRequest winrt
- 9. 如何在同一個ProcessRequest方法中使用多個處理程序?
- 10. HTTPHandler Processrequest()不會從.cs文件調用
- 11. RequestInterceptor中的ProcessRequest永不結束[WCF]
- 12. 轉換ASHX的ProcessRequest到MVC控制器
- 13. 爲什麼將doGet抽象爲processRequest?
- 14. ASP.NET - 有沒有辦法在ProcessRequest函數完成後保持HttpContext連接?
- 15. Sharepoint 2010不會調用我的自定義HttpHandler的ProcessRequest
- 16. 在ASP.NET頁面處理異常的ProcessRequest中
- 17. HttpContext.Current和ProcessRequest(HttpContext上下文)是否相等?
- 18. 如何獲取HttpHandler ProcessRequest中的字符串數組值。
- 19. 製作processRequest等待另一個線程結束
- 20. doGet()/ doPost()和processRequest()之間有什麼區別?
- 21. 如何在.ashx Web處理程序文件中找到稱爲ProcessRequest的進程?
- 22. 作爲一個HTTPHandler.ashx完成ProcessRequest如何關閉瀏覽器窗口與代碼
- 23. 在調用GetControllerInstance之前是否可以攔截ProcessRequest來確定表單超時?
- 24. 重載方法和方法
- 25. html()方法與text()方法
- 26. Ruby方法。開關方法
- 27. ParMap方法替代方法
- 28. 方法 - 調用方法
- 29. 添加方法的方法
- 30. AS3方法和sortOn方法
你在說什麼'ProcessRequest()'?你能提供一個例子嗎? – vandale
請澄清您的具體問題或添加其他詳細信息以突出顯示您的需求。正如目前所寫,很難確切地說出你在問什麼。請參閱http://stackoverflow.com/help/how-to-ask頁面以獲得澄清此問題的幫助。 –
因此,我從jsp頁面的ajax請求生成JSON數據並調用doPost方法,我可以使用ProcessRequest方法而不是doPost嗎?謝謝 –