题目内容

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

A. get
B. post
C. get post
D. post get

查看答案
更多问题

LoginServlet是一个Servlet类,代码如下public class LoginServlet extends ___________ {public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {…}public void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {…}}在下划线处应填写()

A. Servlet
B. HttpServlet
C. GenericServlet
D. Cookie

程序中创建了一个Servlet,该Servlet重写了其父类的doGet()和doPost()方法,那么其父类可能是 ()

A. RequestDispatcher
B. HttpServletResponse
C. HttpServletRequest
D. HttpServlet

下面选项中,与web应用具有相同的生命周期的对象是()

A. Servlet
B. ServletConfig
C. GenericServlet
D. ServletContext

下面选项中,用于设置ServletContext的域属性的方法是

A. setAttribute(Stringname,Stringobj)
B. setParameter(Stringname,Objectobj)
C. setAttribute(Stringname,Objectobj)
D. setParameter(Stringname,Objectobj)

答案查题题库