单选题Which interface must a class implement so that instances of the class are notified after any object is added to a session? ()Ajavax.servlet.http.HttpSessionListenerBjavax.servlet.http.HttpSessionValueListenerCjavax.servlet.http.HttpSessionBindingListen

题目
单选题
Which interface must a class implement so that instances of the class are notified after any object is added to a session? ()
A

 javax.servlet.http.HttpSessionListener

B

 javax.servlet.http.HttpSessionValueListener

C

 javax.servlet.http.HttpSessionBindingListener

D

 javax.servlet.http.HttpSessionAttributeListener


相似考题

3. 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.

参考答案和解析
正确答案: C
解析: 暂无解析
更多“单选题Which interface must a class implement so that instances of the class are notified after any object is added to a session? ()A  javax.servlet.http.HttpSessionListenerB  javax.servlet.http.HttpSessionValueListenerC  javax.servlet.http.HttpSessionBinding”相关问题
  • 第1题:

    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

  • 第2题:

    In your web application,you need to execute a block of code whenever the session object is first created. Which design will accomplish this goal?()

    • A、Create an HttpSessionListener class and implement the sessionInitialized method with that block ofcode.
    • B、Create an HttpSessionActivationListener class and implement the sessionCreated method with thatblock of code.
    • C、Create a Filter class, call the getSession(false) method, and if the result was null, then execute that block of code.
    • D、Create an HttpSessionListener class and implement the sessionCreated method with that block of code.

    正确答案:D

  • 第3题:

    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

  • 第4题:

    Which statements about inheritance are true?()         

    • A、 In Java programming language only allows single inheritance.
    • B、 In Java programming language allows a class to implement only one interface.
    • C、 In Java programming language a class cannot extend a class and implement a interface together.
    • D、 In Java programming language single inheritance makes code more reliable.

    正确答案:A,D

  • 第5题:

    Which interface must a class implement so that instances of the class are notified after any object is added to a session? ()

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

    正确答案:C

  • 第6题:

    Which class provides paging functionality for data-bound controls that implement the IPageableItemContainer interface?()

    • A、DataPagingField
    • B、DataPagerCollection
    • C、DataPager
    • D、DataPaging

    正确答案:C

  • 第7题:

    You are developing a Windows Communication Foundation (WCF) service that contains the following service contract.[ServiceContract( )]public interface IPaymentService{ [OperationContract( )] void RecordPayments(Person person);}public class Person{ ... }public class Employee : Person{ ... }public class Customer : Person{ ... }You need to ensure that RecordPayments can correctly deserialize into an Employee or a Customer object. What should you do?()

    • A、Add the following KnownType attribute to the Employee class and to the Customer class. [KnownType(GetType(Person))]
    • B、Implement the IExtensibleDataObject interface in the Person class.
    • C、Implement the IExtension(ofType(T)) interface in the Person class.
    • D、Add the following KnownType attributes to the Person class. [KnownType(GetType(Employee))] [KnownType(GetType(Customer))]

    正确答案:D

  • 第8题:

    单选题
    You are developing a data contract for a Windows Communication Foundation (WCF) service. The data in the data contract must participate in round trips. Strict schema validity is not required. You need to ensure that the contract is forward-compatible and allows new data members to be added to it. Which interface should you implement in the data contract class?()
    A

    ICommunicationObject

    B

    IExtension

    C

    IExtensibleObject

    D

    IExtensibleDataObject


    正确答案: D
    解析: 暂无解析

  • 第9题:

    多选题
    A custom JSP tag must be able to support an arbitrary number of attributes whose names are unknown when the tag class is designed.  Which two are true? ()
    A

    A  element in the echo tag LTD must have the value JSP

    B

    The echo tag handler must define the setAttribute (String key, String value) method

    C

    The true element must appear in the echo tag TLD

    D

    The class implementing the echo tag handler must implement the javax.sevlet.jsp.tagext.IterationTag interface

    E

    The class implementing the echo tag handler must implement the javax.sevlet.jsp.tagext.DynamicAttributes interface


    正确答案: E,B
    解析: 暂无解析

  • 第10题:

    单选题
    In your web application,you need to execute a block of code whenever the session object is first created. Which design will accomplish this goal?()
    A

    Create an HttpSessionListener class and implement the sessionInitialized method with that block ofcode.

    B

    Create an HttpSessionActivationListener class and implement the sessionCreated method with thatblock of code.

    C

    Create a Filter class, call the getSession(false) method, and if the result was null, then execute that block of code.

    D

    Create an HttpSessionListener class and implement the sessionCreated method with that block of code.


    正确答案: C
    解析: 暂无解析

  • 第11题:

    多选题
    Which statements about inheritance are true?()
    A

    In Java programming language only allows single inheritance.

    B

    In Java programming language allows a class to implement only one interface.

    C

    In Java programming language a class cannot extend a class and implement a interface together.

    D

    In Java programming language single inheritance makes code more reliable.


    正确答案: A,C
    解析: 在java中一个类只能有一个直接父类,但是可以实现多个接口,在继承的同时可以实现接口,之所以取消多继承的原因是多继承使得代码产生很多问题,而使用单一继承则可以使代码更可靠。

  • 第12题:

    单选题
    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


    正确答案: C
    解析: 暂无解析

  • 第13题:

    Which interface must a class implement so that instances of the class are notified after any object is addedto a session?()

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

    正确答案:D

  • 第14题:

    Which statements concerning the methods notify() and notifyAll() are true?  

    • A、Instances of class Thread have a method called notify().
    • B、A call to the method notify() will wake the thread that currently owns the monitor of the object.
    • C、The method notify() is synchronized.
    • D、The method notifyAll() is defined in class Thread.
    • E、When there is more than one thread waiting to obtain the monitor of an object, there is no way to be     sure which thread will be notified by the notify() method.

    正确答案:A,E

  • 第15题:

    package geometry;  public class Hypotenuse {  public InnerTriangle it = new InnerTriangle();  class InnerTriangle {  public int base;  public int height;  }  }  Which is true about the class of an object that can reference the variable base? ()

    • A、 It can be any class.
    • B、 No class has access to base.
    • C、 The class must belong to the geometry package.
    • D、 The class must be a subclass of the class Hypotenuse.

    正确答案:C

  • 第16题:

    Given a class whose instances, when found in a collection of objects, are sorted by using the compareTo() method, which two statements are true?()

    • A、The class implements java.lang.Comparable.
    • B、The class implements java.util.Comparator.
    • C、The interface used to implement sorting allows this class to define only one sort sequence.
    • D、The interface used to implement sorting allows this class to define many different sort sequences.

    正确答案:A,C

  • 第17题:

    You want to create a filter for your web application and your filter will implement javax.servlet.Filter. Which two statements are true?()

    • A、Your filter class must implement an init method and a destroy method.
    • B、Your filter class must also implement javax.servlet.FilterChain.
    • C、When your filter chains to the next filter, it should pass the same arguments it received in its doFiltermethod.
    • D、The method that your filter invokes on the object it received that implements javax.servlet.FilterChaincan invoke either another filter or a servlet.
    • E、Your filter class must implement a doFilter method that takes, among other things, anHTTPServletRequest object and an HTTPServletResponse object.

    正确答案:A,D

  • 第18题:

    You are developing a data contract for a Windows Communication Foundation (WCF) service. The data in the data contract must participate in round trips. Strict schema validity is not required. You need to ensure that the contract is forward-compatible and allows new data members to be added to it. Which interface should you implement in the data contract class?()

    • A、ICommunicationObject
    • B、IExtension
    • C、IExtensibleObject
    • D、IExtensibleDataObject

    正确答案:D

  • 第19题:

    单选题
    package geometry;  public class Hypotenuse {  public InnerTriangle it = new InnerTriangle();  class InnerTriangle {  public int base;  public int height;  }  }  Which is true about the class of an object that can reference the variable base? ()
    A

     It can be any class.

    B

     No class has access to base.

    C

     The class must belong to the geometry package.

    D

     The class must be a subclass of the class Hypotenuse.


    正确答案: B
    解析: 暂无解析

  • 第20题:

    单选题
    Which interface must a class implement so that instances of the class are notified after any object is added to a session? ()
    A

     javax.servlet.http.HttpSessionListener

    B

     javax.servlet.http.HttpSessionValueListener

    C

     javax.servlet.http.HttpSessionBindingListener

    D

     javax.servlet.http.HttpSessionAttributeListener


    正确答案: B
    解析: 暂无解析

  • 第21题:

    单选题
    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


    正确答案: D
    解析: 暂无解析

  • 第22题:

    单选题
    Which class provides paging functionality for data-bound controls that implement the IPageableItemContainer interface?()
    A

    DataPagingField

    B

    DataPagerCollection

    C

    DataPager

    D

    DataPaging


    正确答案: B
    解析: 暂无解析

  • 第23题:

    单选题
    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.


    正确答案: A
    解析: 暂无解析

  • 第24题:

    单选题
    Which interface must a class implement so that instances of the class are notified after any object is addedto a session?()
    A

    javax.servlet.http.HttpSessionListener

    B

    javax.servlet.http.HttpSessionValueListener

    C

    javax.servlet.http.HttpSessionBindingListener

    D

    javax.servlet.http.HttpSessionAttributeListener


    正确答案: B
    解析: 暂无解析