猿问

关于Servlet的问题

public class ServletFoo extends HttpServlet{ public void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException IOException{ System.out.println(“get”); } public void doPost(HttpServletRequestrequest.HttpServletResponse response) throws ServletException,IOException{ System.out.println(“post”); doGet(reauest,response); } } 用户在浏览器地址栏中键入正确的请求URL并回车后,在控制台上显示的结果是( )。

  •  A.

    get

  •  B.

    post

  •  C.

    get post

  •  D.

    post get

正确答案:A


慕后端4267039
浏览 857回答 1
1回答

大咪

public void doPost(HttpServletRequestrequest.HttpServletResponse response) throws ServletException,IOException{ System.out.println(“post”); doGet(reauest,response); } } 看后面这句话,是让dopost做了和doget一样的操作,所以输出了get...所以选a,不明白后面的课程里我记得有讲到……
随时随地看视频慕课网APP

相关分类

Java
我要回答