servlet doGet和doPost方法

servlet doGet和doPost方法

我想知道为什么在servlets中,我们在同一个程序中同时使用doGet和doPost方法。它有什么用??

下面的代码是什么意思?

为什么要从doPost调用doGet方法?我对这段代码一点也不清楚。

代码语言:javascript运行复制public class Info extends HttpServlet

{

public void doGet(HttpServletRequest request, HttpServletResponse response)

throws IOException, ServletException

{

}

public void doPost(HttpServletRequest request, HttpServletResponse response)

throws IOException, ServletException

{

doGet(request, response);

}

}谢谢

相关推荐