单选题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?()Asession.removeAll(USE_CASE_ATTRS);Bfor( String attr : USE_CASE_ATTRS ){ session.remove(attr); }Cfor( String attr : USE_CASE_ATTRS ){session.removeAttribute(attr);}Dfor( String attr : USE_CASE_ATTRS ){session.deleteAttribute(attr);}Esession.deleteAllAttributes(USE_CASE_ATTRS);

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


参考解析

解析: 暂无解析

相关考题:

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.

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.

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.

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());

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.

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.

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);

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.

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.

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.

You are troubleshooting an ASP.NET Web application. System administrators have recently expanded your web farm from one to two servers. Users are periodically reporting an error message about invalid view state. You need to fix the problem. What should you do?()A、Set viewStateEncryptionMode to Auto in web.config on both servers.B、Set the machineKey in machine.config to the same value on both servers.C、Change the session state mode to SQLServer on both servers and ensure both servers use the same connection string.D、Override the SavePageStateToPersistenceMedium and LoadPageStateFromPersistenceMedium methods in the page base class to serialize the view state to a local web server file.

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、Use service behavior and set the maxConcurrentCalls attribute.B、Use endpoint behavior and set the maxBatchSize attribute.C、Use endpoint behavior and set the maxPendingReceives attribute.D、Use endpoint behavior.

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. The application uses Session objects. You are modifying the application to run on a Web farm. You need to ensure that the application can access the Session objects from all the servers in the Web farm. You also need to ensure that when any server in the Web farm restarts or stops responding, the Session objects are not lost.  What should you do?()A、Use the InProc Session Management mode to store session data in the ASP.NET worker process. B、Use the SQLServer Session Management mode to store session data in a common Microsoft SQL Server 2005 database. C、Use the SQLServer Session Management mode to store session data in an individual database for each Web server in the Web farm. D、Use the StateServer Session Management mode to store session data in a common State Server process on a Web server in the Web farm.

Your network contains a Windows Server 2008 server that has the Web Server (IIS) server role installed.  You have a Web application that uses a custom application pool. The application pool is set to recycle every 1,440 minutes. The Web application does not support multiple worker processes.  You need to configure the application pool to ensure that users can access the Web application after the application pool is recycled. What should you do?()A、Set the Shutdown Executable option to True.B、Set the Process Orphaning Enabled option to True.C、Set the Disable Overlapped Recycling option to True.D、Set the Disable Recycling for Configuration Changes option to True.

You have a single Active Directory directory service domain. You have an application that adds Active Directory Schema attributes during installation. The attributes replicate as part of global catalog replication. Your user account is a member of the Domain Admins, Schema Admins, and Enterprise Admins global groups. You test the application and decide not to deploy it to production.  You need to ensure that the attributes that are added by the application are no longer available in Active Directory.  Using the Active Directory Schema snap-in,what should you do?()A、 Clear the Index this attribute in the Active Directory option for each attribute that is added by the application.B、 Clear the Attribute is active option for each attribute that is added by the application.C、 Clear the Replicate this attribute to the Global Catalog option for each attribute that is added by the application.D、 Clear the Allow this attribute to be shown in advanced view option for each attribute that is added by the application.

You write a logging function for a Web Form. You call the logging function from the Page_Unload event handler. You test the Web Form and notice that the Page_Unload event handler does not call the logging function. You need to ensure that the logging function is called. What are two possible ways to achieve this goal? ()A、Set the Page attribute to AutoEventWireup="False". Remove the attribute onunload="Page_Unload" from the Web Form element.B、Set the Page attribute to AutoEventWireup="False". Add the attribute OnUnload="Page_Unload" to the Web Form element.C、Set the Page attribute to AutoEventWireup="False". Add the Web Form attribute autocomplete=on.D、Set the Page attribute to AutoEventWireup="True".

You modify an existing Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.  You add a theme to the ASP.NET application.  You need to apply the theme to override any settings of individual controls.  What should you do?()A、In the Web.config file of the application,set the Theme attribute of the pages element to the name of the theme.B、In the Web.config file of the application,set the StyleSheetThemeattribute of the pages element to the name of the theme.C、Add a master page to the application. In the @Master directive,set the Theme attribute to the name of the theme.D、Add a master page to the application. In the @Master directive,set the StyleSheetTheme attribute to the name of the theme.

单选题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?()Asession.removeAll(USE_CASE_ATTRS);Bfor ( String attr : USE_CASE_ATTRS ) {session.remove(attr);}Cfor ( String attr : USE_CASE_ATTRS ) {session.removeAttribute(attr);}Dfor ( String attr : USE_CASE_ATTRS ) {session.deleteAttribute(attr);}Esession.deleteAllAttributes(USE_CASE_ATTRS);

单选题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 withoutrecompiling the application.  What should you do? ()AEdit the ASP.NET runtime version in IIS 6.0.BEdit the System.Web section handler version number in the machine.config file.CAdd the requiredRuntime configuration element to the Web.config file and set the version attribute to v3.5.DAdd the supportedRuntime configuration element in the Web.config file and set the version attribute to v3.5.

单选题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?()AAccess the personalization data from the Session property of the HttpContext object.BAccess the personalization data from the Application property of the HttpContext object.CAccess the personalization data from the Cache property of the HttpContext object.DAccess the personalization data from the Profile property of the HttpContext object.

单选题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? ()AUse service behavior and set the maxConcurrentCalls attribute.BUse endpoint behavior and set the maxBatchSize attribute.CUse endpoint behavior and set the maxPendingReceives attribute.DUse endpoint behavior.

单选题You have a single Active Directory directory service domain. You have an application that adds Active Directory Schema attributes during installation. The attributes replicate as part of global catalog replication. Your user account is a member of the Domain Admins, Schema Admins, and Enterprise Admins global groups. You test the application and decide not to deploy it to production.  You need to ensure that the attributes that are added by the application are no longer available in Active Directory.  Using the Active Directory Schema snap-in,what should you do?()A Clear the Index this attribute in the Active Directory option for each attribute that is added by the application.B Clear the Attribute is active option for each attribute that is added by the application.C Clear the Replicate this attribute to the Global Catalog option for each attribute that is added by the application.D Clear the Allow this attribute to be shown in advanced view option for each attribute that is added by the application.

单选题Which statement is true about web container session management?()AAccess to session-scoped attributes is guaranteed to be thread-safe by the web container.BTo activate URL rewriting, the developer must use the HttpServletResponse.setURLRewriting method.CIf the web application uses HTTPS, then the web container may use the data on the HTTPS request stream to identify the client.DThe 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.

单选题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?()AThe object of the manager attribute should implement the HttpSessionBindingListener and it should call the removeAttribute method on the appropriate session attributes.BThe object of the manager attribute should implement the HttpSessionListener and it should call the removeAttribute method on the appropriate session attributes.CThe object of the manager attribute should implement the HttpSessionBindingListener and it should call the deleteAttribute method on the appropriate session attributes.DThe object of the manager attribute should implement the HttpSessionListener and it should call the deleteAttribute method on the appropriate session attributes.

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

单选题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?()AUser user = // retrieve the User object from the database session.setDurationInterval(user.getSessionDuration());BUser user = // retrieve the User object from the database session.setMaxDuration(user.getSessionDuration());CUser user = // retrieve the User object from the database session.setInactiveInterval(user.getSessionDuration());DUser user=//retrieve the User object from the database session.setDuration(user.getSessionDuratio());EUser user = // retrieve the User object from the database session.setMaxInactiveInterval(user.getSessionDuration());

单选题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?()ACreate an HttpSessionAttributeListener class and implement the attributeDeleted method and log the attribute name using the getName method on the event object.BCreate an HttpSessionAttributeListener class and implement the attributeRemoved method and log the attribute name using the getName method on the event object.CCreate an SessionAttributeListener class and implement the attributeRemoved method and log the attribute name using the getAttributeName method on the event object.DCreate an SessionAttributeListener class and implement the attributeDeleted method and log the attribute name using the getAttributeName method on the event object.

单选题You modify an existing Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.  You add a theme to the ASP.NET application.  You need to apply the theme to override any settings of individual controls.  What should you do?()AIn the Web.config file of the application,set the Theme attribute of the pages element to the name of the theme.BIn the Web.config file of the application,set the StyleSheetThemeattribute of the pages element to the name of the theme.CAdd a master page to the application. In the @Master directive,set the Theme attribute to the name of the theme.DAdd a master page to the application. In the @Master directive,set the StyleSheetTheme attribute to the name of the theme.