SCWCD(310-083)

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

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

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

第1题:

You are implementing an ASP.NET application that uses data-bound GridView controls in multiple pages. You add JavaScript code to periodically update specific types of data items in these GridView controls. You need to ensure that the JavaScript code can locate the HTML elements created for each row in these GridView controls, without needing to be changed if the controls are moved from one page to another. What should you do?()

  • A、Replace the GridView control with a ListView control.
  • B、Set the ClientIDMode attribute to Predictable in the web.config file.
  • C、Set the ClientIDRowSuffix attribute of each unique GridView control to a different value.
  • D、Set the @ OutputCache directives VaryByControl attribute to the ID of the GridView control.

正确答案:B

第2题:

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

第3题:

Your company has an existing Windows Communication Foundation (WCF) service that allows business partners to place orders. The service uses netMsmqBinding. You find that processing every order in its own transaction is causing a delay. You need to ensure that the service is configured to process multiple orders in one transaction. What should you do? ()

A. Useservice behavior and set the maxConcurrentCalls attribute.

B. Useendpoint behavior and set the maxBatchSize attribute.

C. Useendpoint behavior and set the maxPendingReceives attribute.

D. Useendpoint behavior.


参考答案:B

第4题:

You have a Web application that is configured for personalization. You need to access personalization data from one of the pages of the Web application by using the minimum amount of administrative effort. What should you do? ()

  • A、Access the personalization data from the Session property of the HttpContext object.
  • B、Access the personalization data from the Application property of the HttpContext object.
  • C、Access the personalization data from the Cache property of the HttpContext object.
  • D、Access the personalization data from the Profile property of the HttpContext object.

正确答案:D

第5题:

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

第6题:

Users of your web application have requested that they should be able to set the duration of their sessions.So for example, one user might want a webapp to stay connected for an hour rather than the webapp’sdefault of fifteen minutes; another user might want to stay connected for a whole day. Furthermore, youhave a special login servlet that performs user authentication and retrieves the User object from the database. You want to augment this code to set up the user’s specified session duration. Which codesnippet in the login servlet will accomplish this goal?()

  • A、User user = // retrieve the User object from the database session.setDurationInterval(user.getSessionDuration());
  • B、User user = // retrieve the User object from the database session.setMaxDuration(user.getSessionDuration());
  • C、User user = // retrieve the User object from the database session.setInactiveInterval(user.getSessionDuration());
  • D、User user=//retrieve the User object from the database session.setDuration(user.getSessionDuratio());
  • E、User user = // retrieve the User object from the database session.setMaxInactiveInterval(user.getSessionDuration());

正确答案:E

第7题:

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

第8题:

You are evaluating a Windows Azure application. The application uses one instance of a web role. The role instance size is set to Medium. The application does not use SQL Azure.   You have the following requirements for scaling the application:   - Maximize throughput.  - Minimize downtime while scaling. - Increase system resources.   You need to recommend an approach for scaling the application.  What should you recommend?()  

  • A、 Set up vertical partitioning.
  • B、 Set up horizontal partitioning.
  • C、 Increase the number of role instances.
  • D、 Change the role instance size to large.

正确答案:C

第9题:

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

第10题:

You have a Microsoft ASP.NET Framework version 1.0 application. The application does not use any features that are deprecated in the Microsoft .NET Framework version 3.5. The application runs on Microsoft IIS 6.0.  You need to configure the application to use the ASP.NET Framework version 3.5 without recompiling the application.  What should you do?()

  • A、Edit the ASP.NET runtime version in IIS 6.0. 
  • B、Edit the System.Web section handler version number in the machine.config file. 
  • C、Add the requiredRuntime configuration element to the Web.config file and set the version attribute to v3.5. 
  • D、Add the supportedRuntime configuration element in the Web.config file and set the version attribute to v3.5.

正确答案:A

更多相关问题