单选题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?()ACreate an HttpSessionListener class and implement the sessionInitialized method with that block ofcode.BCreate an HttpSessionActivationListener class and implement the sessionCreated method with thatblock of code.CCreate a Filter class, call the getSession(false) method, and if the result was null, then execute that block of code.DCreate an HttpSessionListener class and implement the sessionCreated method with that block of code.

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


参考解析

解析: 暂无解析

相关考题:

You create a Web application for your company‘s intranet. You want to enable users to customize their versions of the intranet home page. You create sections of content as Web Parts. You need to ensure that users can customize content at any time.Which two code segments should you use?()A.B.C.D.

Exhibit: You are developing a Web application. The Web application uses a GridView control to display data. You build your Web Forms for the Web application by dragging and dropping tables from the Data Connections tree in Server Explorer. You need to add a connection to your data by using the Add Connection dialog box as shown in the exhibit. During the process, you need to configure the .NET Data Provider that you use to create the data source objects. What should you do?()A. Right-click the connection, and click Properties. Modify the Provider property of the data connection.B. Click the Change button, and change the data provider for the selected data source.C. Click the Advanced button, and change the Data Source property to the target provider.D. Click the Advanced button, and change the Application Name property to the target provider.

To generate recommendations to improve the performance of a set of SQL queries in an application, you execute the following blocks of code:The blocks of code execute successfully; however, you do not get the required outcome. What could be the reason?()A. A template needs to be associated with the task.B.A workload needs to be associated with the task.C. The partial or complete workload scope needs to be associated with the task.D. The type of structures (indexes, materialized views, or partitions) to be recommended need to be specified for the task.

You work as a Web Developer at Certkiller.com. You are in the process of creating a Webapplication using Microsoft ASP.NET 3.5.  You host the Web application in Microsoft Internet Information Services (IIS) 6.0. You browse theapplication and receive the following error message:  Server Application Unavailable  The web application you are attempting to access on this web server is currently unavailable.Please hit the "Refresh" button in your web browser to retry your request.  You view the Application event log and discover the following message:  It is not possible to run two different versions of ASP.NET in the same IIS process. Please use theIIS Administration Tool to reconfigure your server to run the application in a separate process.  To ensure productivity you need to solve this problem as quick as possible.  What should you do?()A、You should change the IIS isolation mode.B、You should assign the application to another application pool.C、You should configure all applications that are part of your application's application pool in orderto use the same version of ASP.NET.D、You should run the Aspnet_regiis.exe Tool.E、You should restart the application pool that hosts the application.

As an administrator at Cer-tech .com, you install Web server (IIS) role on a server that runs WindowsServer 2008. You created a new site called Cer-tech .com. You need to install an application on thewebsite called web content. You copy the application to the server. What should you do to add theapplication on the website?()A、Create a virtual directory and copy the website contents in it. Copy the application in the directory andinstall itB、Execute appcmd command on the command prompt on the serverC、Open the IIS Manager Console and select the website. Select Add ApplicationD、Execute appcmd -t on the command prompt on the server

You are creating a new JSP page and you need to execute some code that acts when the page is firstexecuted, but only once. Which three are possible mechanisms for performing this initialization code?()A、In the init method.B、In the jspInit method.C、In the constructor of the JSP’s Java code.D、In a JSP declaration, which includes an initializer block.E、In a JSP declaration, which includes a static initializer block.

You are creating a templated Web control for use in your Web application. You need to add the Web control to your Web application pages without compiling your control into a .dll file. What should you do?()A、Ensure that the Web control inherits from the WebControl class.B、Ensure that the Web control inherits from the Control class.C、Ensure that the Web control inherits from the CompositeControl class.D、Ensure that the Web control inherits from the UserControl class.

You are working with a team of developers on a Web site. You copy the Web site from the staging server to work on it locally. While making changes, you create new C# source code files and delete old ones. You need to ensure that your changes propagate to the staging server without affecting any files that you have not modified. Which tool should you use? ()A、XCOPYB、the Copy Web toolC、the Publish Web toolD、a Web Setup project

You develop a Web application. Your application contains two settings in the Web.config file. You deploy your application to production. You need to modify the application settings in the production environment without manually editing the XML markup in the Web.config file. What should you do? ()A、Modify the application settings by using the Web Site Administration Tool.B、Modify the application settings by using the Visual Studio property page editor for the project.C、Modify the application settings by using the resource editor.D、Modify the application settings by using the Visual Studio start options editor.

You are developing a Web application. The Web application restricts access to an administrative page. The Web application uses the following code segment to protect the page.if (Page.User.Identity.Name != @"CONTOSO/Administrator") { the page, you are redirected to Login.aspx. You discover that the User.Identity.Name property is not being correctly populated. You need to ensure that you can access the page when you are logged on as Administrator. Which two actions should you perform? ()A、In the Web.config file, enable impersonation.B、In IIS, enable anonymous access.C、In IIS, disable anonymous access.D、In the Web.config file, set the authentication mode to Windows.

You create a Web Form. The Web Form allows users to log on to a Web site. You implement the login logic using a Login control named Login1. The membership data for the application is stored in a SQL Express database in the App_Data directory. You need to configure your application so that the membership data is stored in a local Microsoft SQL Server database. You add the following code segment to the Web.config file. Which two additional actions should you perform?()A、Use Aspnet_regsql.exe to create the Microsoft SQL Server database.B、Set Login1's MembershipProvider property to MySqlProviderConnection.C、Add the following code segment to the Web.config file.connectionStrings add name="MySqlProviderConnection" connectionString="valid connection string" //connectionStringsD、Add the following code segment to the Web.config file.appSettingsadd key="MySqlProviderConnection" value="valid connection string" //appSettingsE、In the ASP.NET configuration settings within IIS, ensure that Role Management Enabled is selected.F、Use the Web Site Administration Tool to select AspNetSqlMembershipProvider as the membership provider for your application.

You work as a Web Application Developer at Certkiller.com. You make use of .NET Frameworkv3.5 to create an ASP.NET application.  You decide to create a Web user control named KingShare. KingShare is compiled as a library.The code segment below is written for KingShare. (The line numbers is included for reference purposes) 1 protected override void OnInit(EventArgs e) 2 { 3 base.OnInit(e); 4 5 }  The master pages in the application contains the %@ Master Language="C#" EnableViewState="false" % directive. You receive an instruction from the network administratorto make sure that the KingShare state is able to persist on the pages that reference the masterpage. You should thus identify the appropriate code segment you need to add to line 4 to achievethis.  What should you do?()A、Your best option would be to insert Page.RegisterRequiresPostBack(this)B、Your best option would be to insert Page.RegisterRequiresControlState(this)C、Your best option would be to insert Page.UnregisterRequiresControlState(this)D、Your best option would be to insert Page.RegisterStartupScript("KingShare","server")

单选题You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. You plan to deploy the application to a test server.  You need to ensure that during the initial request to the application, the code-behind files for the Web pages are compiled. You also need to optimize the performance of the application.  Which code fragment should you add to the Web.config file?()Acompilation debug=true Bcompilation debug=false Ccompilation debug=true batch=true Dcompilation debug=false batch=false

单选题You are developing a Web application. Your code restricts access to some pages based on the users credentials. You need to configure IIS to supply the user's Windows credentials to your Web application. These credentials must be encrypted. What should you do? ()AEnable Anonymous access. Enable Integrated Windows authentication.BEnable Anonymous access. Enable Basic authentication.CDisable Anonymous access. Enable Integrated Windows authentication.DDisable Anonymous access. Enable Basic authentication.

多选题You are creating a new JSP page and you need to execute some code that acts when the page is firstexecuted, but only once. Which three are possible mechanisms for performing this initialization code?()AIn the init method.BIn the jspInit method.CIn the constructor of the JSP’s Java code.DIn a JSP declaration, which includes an initializer block.EIn a JSP declaration, which includes a static initializer block.

单选题You deploy your companys Internet Web site. You need to deny anonymous access to the Web site, allowing only authenticated users. Which code segment should you use?()Aauthorization allow users=?/ /authorizationBauthorization deny users=?/ /authorizationCauthorization deny users=*//authorizationDauthorization allow users=*/ /authorization

单选题You want to enable users of a Web application to modify the Web application's UI and behavior. These modifications must be maintained at the user level so that when users return to the Web application, the changes are still in effect. You need to achieve this goal by using the minimum amount of custom code. What should you do?()APersist control data by using view state.BUse Web Part controls.CMaintain a profile for each user.DEnable session state on the Web application.

单选题You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. The application requires frequent updates. You want to use the ClickOnce technology to distribute the application to Internet users. You need to ensure that the application is automatically updated without requiring user intervention. You also need to ensure that the users execute the most recent version of the application. What should you do when you publish the application? ()AUse Install the application from a file share. Select the Application is available online and offline option.BUse Install the application from CD-ROM or a DVD-ROM. Select the Application will not check for updates option.CUse Install the application from a Web site. Select the Application is available online only option.DUse Install the application from a Web site. Select the Application is available online and offline option.

多选题You work as a Web Developer at Certkiller.com. You are in the process of creating a Webapplication using Microsoft ASP.NET 3.5.  You host the Web application in Microsoft Internet Information Services (IIS) 6.0. You browse theapplication and receive the following error message:  Server Application Unavailable  The web application you are attempting to access on this web server is currently unavailable.Please hit the "Refresh" button in your web browser to retry your request.  You view the Application event log and discover the following message:  It is not possible to run two different versions of ASP.NET in the same IIS process. Please use theIIS Administration Tool to reconfigure your server to run the application in a separate process.  To ensure productivity you need to solve this problem as quick as possible.  What should you do?()AYou should change the IIS isolation mode.BYou should assign the application to another application pool.CYou should configure all applications that are part of your application's application pool in orderto use the same version of ASP.NET.DYou should run the Aspnet_regiis.exe Tool.EYou should restart the application pool that hosts the application.

多选题You create a Microsoft ASP.NET Web application by using the Microsoft .NET Framework version 3.5.  When you review the application performance counters, you discover that there is an unexpected increase in the value of the Application Restarts counter. You need to identify the reasons for this increase.  What are three possible reasons that could cause this increase?()ARestart of the Microsoft IIS 6.0 host.BRestart of the Microsoft Windows Server 2003 that hosts the Web application.CAddition of a new assembly in the Bin directory of the application.DAddition of a code segment that requires recompilation to the ASP.NET Web application.EEnabling of HTTP compression in the Microsoft IIS 6.0 manager for the application.FModification to the Web.config file in the system.web section for debugging the application.