SCWCD(310-083)

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

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

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

第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题:

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

第3题:

A developer is designing the presentation tier for a web application that relies on a complex session bean.The session bean is still being developed and the APIs for it are NOT finalized. Any changes to the sessionbean API directly impacts the development of the presentation tier.  Which design pattern provides a meansto manage the uncertainty in the API?()

  • A、View Helper
  • B、Front Controller
  • C、Composite View
  • D、Intercepting Filter
  • E、Business Delegate

正确答案:E

第4题:

Which the statement is true about web container session management()?

  • A、 Access to session-scoped attributes is guaranteed to be thread-safe by the web container.
  • B、 To activate URL rewriting, the developer must use the HttpServletResponse.setURLRewriting method.
  • C、 If the web application uses HTTPS, then the web container may use the data on the HTTPS request stream to identify the client.
  • D、 The JSESSIONID cookie is stored permanently on the client so that a user may return to the web application and the web container will rejoin that session.

正确答案:C

第5题:

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

第6题:

During initial cluster planning session, a requirement is mandated that application monitoring will  Be used to monitor the production database and three application servers. Since all the application servers rely on the database being active, only one resource group has been planned to manage the starting/stopping of the cluster resources.  How ill the initial design impact the use of application monitoring?()  

  • A、 Only one application server per resource group can be monitored.
  • B、 Process monitoring is part of RSCT and requires no special scripts.
  • C、 Any application can be monitored as long as it has an application server.
  • D、 Having all application servers in one resource group improves recovery time.

正确答案:A

第7题:

One of the use cases in your web application uses many session-scoped attributes. At the end of the usecase,you want to clear out this set of attributes from the session object. Assume that this static variableholds this set of attribute names: 201.private static final Set USE_CASE_ATTRS;  202.static { 203.USE_CASE_ATTRS.add("customerOID"); 204.USE_CASE_ATTRS.add("custMgrBean"); 205.USE_CASE_ATTRS.add("orderOID"); 206.USE_CASE_ATTRS.add("orderMgrBean"); 207.} Which code snippet deletes these attributes from the session object?()

  • A、session.removeAll(USE_CASE_ATTRS);
  • B、for ( String attr : USE_CASE_ATTRS ) {session.remove(attr);}
  • C、for ( String attr : USE_CASE_ATTRS ) {session.removeAttribute(attr);}
  • D、for ( String attr : USE_CASE_ATTRS ) {session.deleteAttribute(attr);}
  • E、session.deleteAllAttributes(USE_CASE_ATTRS);

正确答案:C

第8题:

A Company.com developer is designing the presentation tier for a web application that relies on a complex session bean. The session bean is still being developed and the APIs for are NOT finalized. Any changes to the session bean API directly impacts the development of the presentation tier.  Which design pattern provides a means to manage the uncertainty in the API?()

  • A、 View Helper
  • B、 Front Controller
  • C、 Composite View
  • D、 Intercepting Filter
  • E、 Business Delegate
  • F、 Chain of Responsibility

正确答案:E

第9题:

Your web application uses a simple architecture in which servlets handle requests and then forward to aJSP using a request dispatcher. You need to pass information calculated in the servlet to the JSP for view generation.This information must NOT be accessible to any other servlet,JSP or session in the webapp. Which two techniques can you use to accomplish this goal?()

  • A、Add attributes to the session object.
  • B、Add attributes on the request object.
  • C、Add parameters to the request object.
  • D、Use the pageContext object to add request attributes.
  • E、Add parameters to the JSP’s URL when generating the request dispatcher.

正确答案:B,E

第10题:

A customer has a critical, performance-sensitive web application that connects to a multinode  Oracle RAC database. Which feature of WebLogic can provide significant performance benefit?()

  • A、The Web Session Affinity feature of Active GridLink for RAC
  • B、WebLogic Clustering  
  • C、The Transaction Affinity feature of Active GridLink for RAC
  • D、Coherence*Web Session Replication

正确答案:C

更多相关问题