Given the HttpServlet

题目

Given the HttpServlet code:   getServletContext().setAttribute(“foo”, “value”); What is the result?()

  • A、 The attribute foo is placed in the application
  • B、 A ServletContextListener registered for that servlet is notified
  • C、 A ServletAttributeListener registered for that servlet is notified
  • D、 An HttpSessionAttributeListener registered for that servlet is notified
如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

____ a lift in your car, I would not have been home.

A、Had you not given me

B、I had not given

C、You had not given me

D、Had I not given


答案:B

第2题:

Given: String value = getServletContext().getInitParameter("foo"); in an HttpServlet and a web applicationdeployment descriptor that contains: foo frodo Which two are true?()

  • A、The foo initialization parameter CANNOT be set programmatically.
  • B、Compilation fails because getInitParameter returns type Object.
  • C、The foo initialization parameter is NOT a servlet initialization parameter.
  • D、Compilation fails because ServletContext does NOT have a getInitParameter method.
  • E、The foo parameter must be defined within the  element of the deployment descriptor.

正确答案:A,C

第3题:

在J2EE中,对于HttpServlet类的描述,正确的是()。

A.我们自己编写的Servlet继承了HttpServlet类,一般只需覆盖doPost或者doGet方法,不必覆盖service()方法。因为一个service()方法是空的

B.HttpServlet类扩展了GenericServlet类,实现了GenericServlet类的抽象方法service()

C.HttpServlet类有两个service()方法

D.我们自己编写的Servlet继承了HttpServlet类,一般只需覆盖doPost或者doGet方法,不必覆盖service()方法。因为一个service()方法会调用doPost或者doGet方法


参考答案:B, C, D

第4题:

HttpServlet类中定义了Servlet对象必须实现的init(),Service(),destroy()等方法。()


正确答案:错误

第5题:

自定义的servlet应重载Httpservlet类的()方法以响应客户发出的post 请求方法。

  • A、Post
  • B、Onpost
  • C、doPost
  • D、Responspost

正确答案:C

第6题:

Servlet中,使用()接口中定义的()方法来处理客户端发出的表单数据请求。

  • A、HttpServlet,doPost
  • B、ServletRequest,doGet
  • C、ServletRequest,doPost
  • D、HttpServlet,doHead

正确答案:A

第7题:

Why does IS-IS use the SPF algorithm?()

  • A、to determine the pseudonode ID
  • B、to determine the next hop to a given destination
  • C、to determine the complete path to a given destination
  • D、to determine the number of routers present in a given area

正确答案:B

第8题:

在J2EE中,以下关于HttpServlet说法错误的是( )

A、HttpServlet是一个抽象类

B、HttpServlet扩展了GenericServlet类

C、HttpServlet类的子类必须至少重写service方法

D、HttpServlet位于javax.servlet.http包中


正确答案:C

第9题:

HttpServlet类中定义了Servlet对象必须实现()。

  • A、Stop()
  • B、Init()
  • C、Service()
  • D、Destroy()

正确答案:B,C,D

第10题:

J2EE中以下关于HttpServlet的说法错误的是()

  • A、 HttpServlet是一个抽象类
  • B、 HttpServlet类扩展了GenericServlet类
  • C、 HttpServlet类的子类必须至少重写service方法
  • D、 HttpServlet位于javax.servlet.http包中

正确答案:C

更多相关问题