单选题Which interface must a session attribute implement if it needs to be notified when a web container persistsa session?()A javax.servlet.http.HttpSessionListenerB javax.servlet.http.HttpSessionBindingListenerC javax.servlet.http.HttpSessionAttributeListe

题目
单选题
Which interface must a session attribute implement if it needs to be notified when a web container persistsa session?()
A

javax.servlet.http.HttpSessionListener

B

javax.servlet.http.HttpSessionBindingListener

C

javax.servlet.http.HttpSessionAttributeListener

D

javax.servlet.http.HttpSessionActivationListener

如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

Your web application requires the adding and deleting of many session attributes during a complex usecase. A bug report has come in that indicates that an important session attribute is being deleted too soonand a NullPointerException is being thrown several interactions after the fact. You have decided to create asession event listener that will log when attributes are being deleted so you can track down when theattribute is erroneously being deleted. Which listener class will accomplish this debugging goal?()

  • A、Create an HttpSessionAttributeListener class and implement the attributeDeleted method and log the attribute name using the getName method on the event object.
  • B、Create an HttpSessionAttributeListener class and implement the attributeRemoved method and log the attribute name using the getName method on the event object.
  • C、Create an SessionAttributeListener class and implement the attributeRemoved method and log the attribute name using the getAttributeName method on the event object.
  • D、Create an SessionAttributeListener class and implement the attributeDeleted method and log the attribute name using the getAttributeName method on the event object.

正确答案:B

第2题:

Which three are described in the standard web application deployment descriptor?()  

  • A、 session configuration
  • B、 MIME type mappings
  • C、 context root for the application
  • D、 servlet instance pool configuration
  • E、 web container default port bindings
  • F、 ServletContext initialization parameters

正确答案:A,B,F

第3题:

Select 3 AVPs (Attribute-Value Pair) which MUST be present in the ICRQ:()

  • A、Message Type
  • B、Calling Number
  • C、Assigned Session ID
  • D、Called Number
  • E、Call Serial Number

正确答案:A,C,E

第4题:

You have a use case in your web application that adds several session-scoped attributes. At the end of theuse case, one of these objects, the manager attribute, is removed and then it needs to decide which of theother session-scoped attributes to remove. How can this goal be accomplished?()

  • A、The object of the manager attribute should implement the HttpSessionBindingListener and it should call the removeAttribute method on the appropriate session attributes.
  • B、The object of the manager attribute should implement the HttpSessionListener and it should call the removeAttribute method on the appropriate session attributes.
  • C、The object of the manager attribute should implement the HttpSessionBindingListener and it should call the deleteAttribute method on the appropriate session attributes.
  • D、The object of the manager attribute should implement the HttpSessionListener and it should call the deleteAttribute method on the appropriate session attributes.

正确答案:A

第5题:

Which interface must a session attribute implement if it needs to be notified when a web container persistsa session?()

  • A、javax.servlet.http.HttpSessionListener
  • B、javax.servlet.http.HttpSessionBindingListener
  • C、javax.servlet.http.HttpSessionAttributeListener
  • D、javax.servlet.http.HttpSessionActivationListener

正确答案:D

第6题:

Which interface must a class implement to be informed of a session creation event?()

  • A、 javax.servlet.http.HttpSessionListener
  • B、 javax.servlet.http.HttpSessionBindingListener
  • C、 javax.servlet.http.HttpSessionCreationListener
  • D、 javax.servlet.http.HttpSessionActivationListener

正确答案:A

第7题:

Which three are described in the standard web application deployment descriptor?()

  • A、session configuration
  • B、MIME type mappings
  • C、context root for the application
  • D、servlet instance pool configuration
  • E、web container default port bindings
  • F、Servlet Context initialization parameters

正确答案:A,B,F

第8题:

Given an HttpServletRequest request and an HttpServletResponse response: 41.HttpSession session = null; 42.// insert code here 43.if(session == null) { 44.// do something if session does not exist 45.} else { 46.// do something if session exists47. } To implement the design intent,which statement must be inserted at line 42?()

  • A、session = response.getSession();
  • B、session = request.getSession();
  • C、session = request.getSession(true);
  • D、session = request.getSession(false);
  • E、session = request.getSession("jsessionid");

正确答案:D

第9题:

A session-scoped attribute is stored by a servlet, and then that servlet forwards to a JSP page. Which threejsp:useBean attributes must be used to access this attribute in the JSP page?()

  • A、id
  • B、name
  • C、bean
  • D、type
  • E、scope

正确答案:A,D,E

第10题:

For which three events can web application event listeners be registered?()

  • A、When a session is created
  • B、After a servlet is destroyed
  • C、When a session has timed out
  • D、When a cookie has been created
  • E、When a servlet has forwarded a request
  • F、When a session attribute value is changed

正确答案:A,C,F

更多相关问题