网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
多选题
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 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 are working on an existing Web site. You need to secure the Web site by redirecting all users to the logon page, Login.aspx. After logging on, users must be sent back to the page that they originally requested.Which code segment should you use?()A.B.C.D.

考题 You create a master page named PageBase.master. The master page contains a Label control named lblTitle.You create a content page that references the master page.You need to change the Text property of the master page‘s lblTitle control from the content page.Which code segment should you use?()A.B.C.D.

考题 You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. You create a page that contains the following code fragment:       You write the following code segment in the code-behind file for the page:   void BindData(object sender, EventArgs e) {   lstLanguages.DataSource =  CultureInfo.GetCultures(CultureTypes.AllCultures);   lstLanguages.DataTextField = "EnglishName";  lstLanguages.DataBind();   }   You need to ensure that the lstLanguages ListBox control maintains the selection of the user during postback.  Which line of code should you insert in the constructor of the page?()A、this.Init += new EventHandler(BindData); B、this.PreRender += new EventHandler(BindData); C、lstLanguages.PreRender += new EventHandler(BindData); D、lstLanguages.SelectedIndexChanged += new EventHandler(BindData);

考题 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.

考题 Which three occur during JSP page translation?()A、 The jspInit method is called.B、 The JSP page implementation class is created.C、 The JSP page implementation class is compiled.D、 The JSP page is validated for syntatic correctness.E、 The associated tag files are validated for syntatic correctness.

考题 You have created a JSP that includes instance variables and a great deal of scriptlet code. Unfortunately,after extensive load testing, you have discovered several race conditions in your JSP scriptlet code. To fixthese problems would require significant recoding, but you are already behind schedule. Which JSP codesnippet can you use to resolve these concurrency problems?()A、%@ page isThreadSafe=’false’ %B、%@ implements SingleThreadModel %C、%! implements SingleThreadModel %D、%@ page useSingleThreadModel=’true’ %E、%@ page implements=’SingleThreadModel’ %

考题 You are building your own layout mechanism by including dynamic content for the page’s header and footersections. The footer is always static, but the header generates the  tag that requires the page name tobe specified dynamically when the header is imported. Which JSP code snippet performs the import of theheader content?() titleA、jsp:include page=’/WEB-INF/jsp/header.jsp’jsp:param name=’pageName’ value=’Welcome Page’ / /jsp:includeB、jsp:import page=’/WEB-INF/jsp/header.jsp’jsp:param name=’pageName’ value=’Welcome Page’ / /jsp:importC、jsp:include page=’/WEB-INF/jsp/header.jsp’jsp:attribute name=’pageName’ value=’Welcome Page’ / . /jsp:includeD、jsp:import page=’/WEB-INF/jsp/header.jsp’. jsp:attribute name=’pageName’ value=’Welcome Page’ / . /jsp:import

考题 You are developing an inventory report to list the item number, description price and picture of all inventory items. The layout of each item is a repeating frame that contains three fixed fields and a image. When possible you want all objects in the repeating frame to appear on the same logical page without creating blank pages between instances. Which pagination property would you alter to achieve these results?()A、Page break before. B、Page break after. C、Page protect. D、Keep with anchoring object.

考题 You create a Web Form that allows users to create a new account. You add a CreateUserWizard control by using the following code segment. You need to ensure that the wizard automatically sends an e-mail message to users when they finish creating their accounts. You add a valid element to the Web.config file. Which code segment should you add to the Page_Load event? ()A、Wizard1.RequireEmail = TrueB、Wizard1.Email = "user@address.com"C、Wizard1.MailDefinition.From = "registration@mysite.com"D、SmtpMail.SmtpServer = "mail.contoso.com"

考题 You are creating an ASP.NET Web site. The site has a master page named Custom.master. The code-behind file for Custom.master contains the following code segment.Partial Public Class Custom  Inherits System.Web.UI.MasterPagePublic Property Region As String    Protected Sub Page_Load(ByVal sender As Object,ByVal e As System.EventArgs) Handles Me.LoadEnd SubEnd Class You create a new ASP.NET page and specify Custom.master as its master page.You add a Label control named lblRegion to the new page.  You need to display the value of the master pages Region property in lblRegion.What should you do? ()A、Add the following code segment to the Page_Load method of the page code-behind file. Dim custom As Custom = Me.Parent  lblRegion.Text = custom.RegionB、Add the following code segment to the Page_Load method of the page code-behind file. Dim custom As Custom = Me.Master  lblRegion.Text = custom.RegionC、Add the following code segment to the Page_Load method of the Custom.Master.vb code-behind file. Dim lblRegion As Label = Page.FindControl("lblRegion") lblRegion.Text = Me.RegionD、Add the following code segment to the Page_Load method of the Custom.Master.vb code-behind file. Dim lblRegion As Label = Master.FindControl("lblRegion") lblRegion.Text = Me.Region

考题 You are creating a custom user control. The custom user control will be used on 10 Web Forms for an ASP.NET Web site that allows users to register and log on to a personalized experience. The custom user control uses two TextBox controls and two Button controls. You need to ensure that the controls are visible only when users are not logged on to the Web site. You also need to minimize the amount of effort in development and maintenance for the Web site. Which two actions should you perform? ()A、Add the OnClick event handler for the Login button to the code used in the custom user control.B、Add the OnClick event handler for the Login button to the code used in the Web Form where the control is added.C、In the Page_Load method of the Web Form, add a code segment to set the visibility of the TextBox and Button controls where the control is added.D、In the Page_Load method of the custom user control, add a code segment to set the visibility of the TextBox and Button controls.

考题 You are testing an existing ASP.NET page. The page includes a text box. You are able to execute malicious JavaScript code by typing it in the text box and submitting. You need to configure the page to prevent JavaScript code from being submitted by the text box. In the @ Page directive, which attribute should you set to true?()A、the EnableEventValidation attributeB、the ResponseEncoding attributeC、the ValidateRequest attributeD、the Strict attribute

考题 You create a Web page named TestPage.aspx and a user control named TestUserControl.ascx. TestPage.aspx uses TestUserControl.ascx as shown in the following line of code. On TestUserControl.ascx, you need to add a read-only member named CityName to return the value "New York". You also must add code to TestPage.aspx to read this value. Which two actions should you perform?()A、Add the following line of code to the TestUserControl.ascx.cs code-behind file. public string CityName { get { return "New York"; } } B、Add the following line of code to the TestUserControl.ascx.cs code-behind file. protected readonly string CityName = "New York"; C、Add the following code segment to the TestPage.aspx.cs code-behind file. protected void Page_Load(object sender, EventArgs e) { string s = testControl.CityName; } D、Add the following code segment to the TestPage.aspx.cs code-behind file. protected void Page_Load(object sender, EventArgs e) { string s = testControl.Attributes["CityName"]; } 

考题 You are creating an undo buffer that stores data modifications.You need to ensure that the undo functionality undoes the most recent data modifications first.You also need to ensure that the undo buffer permits the storage of strings only.Which code segment should you use?()A、Stackstring undoBuffer=new Stackstring();B、Stack undoBuffer=new Stack();C、Queuestring undoBuffer=new Queuestring();D、Queue undoBuffer=new Queue();

考题 You are developing an ASP.NET Web page. The page includes a List instance. You add a FormView control to display a single Product from this list. You need to bind the list to the FormView control. Which FormView property should you set in the code-behind file?()A、DataSourceB、DataSourceIDC、DataKeyNamesD、DataMember

考题 You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.  You create a page that contains the following code fragment.  | English | Chinese | Japan | Korean | - 92 - Test Information Co., Ltd. All rights reserved.   You write the following code segment in the code-behind file for the page.  void BindData(object sender, EventArgs e) {  lstLanguages.DataSource =  CultureInfo.GetCultures(CultureTypes.AllCultures);  lstLanguages.DataTextField = "EnglishName";  lstLanguages.DataBind();  }  You need to ensure that the lstLanguages ListBox control maintains the selection of the user during postback.  Which line of code should you insert in the constructor of the page?()A、this.Init += new EventHandler(BindData); B、this.PreRender += new EventHandler(BindData); C、lstLanguages.PreRender += new EventHandler(BindData); D、lstLanguages.SelectedIndexChanged += new EventHandler(BindData); 

考题 单选题You are building your own layout mechanism by including dynamic content for the page’s header and footersections. The footer is always static, but the header generates the  tag that requires the page name tobe specified dynamically when the header is imported. Which JSP code snippet performs the import of theheader content?()A jsp:include page=’/WEB-INF/jsp/header.jsp’jsp:param name=’pageName’ value=’Welcome Page’ / /jsp:includeB jsp:import page=’/WEB-INF/jsp/header.jsp’jsp:param name=’pageName’ value=’Welcome Page’ / /jsp:importC jsp:include page=’/WEB-INF/jsp/header.jsp’jsp:attribute name=’pageName’ value=’Welcome Page’ / . /jsp:includeD jsp:import page=’/WEB-INF/jsp/header.jsp’. jsp:attribute name=’pageName’ value=’Welcome Page’ / . /jsp:import

考题 多选题Which three occur during JSP page translation?()AThe jspInit method is called.BThe JSP page implementation class is created.CThe JSP page implementation class is compiled.DThe JSP page is validated for syntatic correctness.EThe associated tag files are validated for syntatic correctness.

考题 多选题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" Then Response.Redirect("login.aspx")End IfYou are logged on as Administrator. When you display 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? ()AIn the Web.config file, enable impersonation.BIn IIS, enable anonymous access.CIn IIS, disable anonymous access.DIn the Web.config file, set the authentication mode to Windows.

考题 多选题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? ()AIn the Web.config file, enable impersonation.BIn IIS, enable anonymous access.CIn IIS, disable anonymous access.DIn the Web.config file, set the authentication mode to Windows.

考题 多选题You create a Web page named TestPage.aspx and a user control named TestUserControl.ascx. TestPage.aspx uses TestUserControl.ascx as shown in the following line of code. On TestUserControl.ascx, you need to add a read-only member named CityName to return the value "New York". You also must add code to TestPage.aspx to read this value. Which two actions should you perform?()AAdd the following line of code to the TestUserControl.ascx.cs code-behind file. public string CityName { get { return New York; } }BAdd the following line of code to the TestUserControl.ascx.cs code-behind file. protected readonly string CityName = New York;CAdd the following code segment to the TestPage.aspx.cs code-behind file. protected void Page_Load(object sender, EventArgs e) { string s = testControl.CityName; }DAdd the following code segment to the TestPage.aspx.cs code-behind file. protected void Page_Load(object sender, EventArgs e) { string s = testControl.Attributes[CityName]; }

考题 多选题You are creating a custom user control. The custom user control will be used on 10 Web Forms for an ASP.NET Web site that allows users to register and log on to a personalized experience.The custom user control uses two TextBox controls and two Button controls.You need to ensure that the controls are visible only when users are not logged on to the Web site. You also need to minimize the amount of effort in development and maintenance for the Web site. Which two actions should you perform?()AAdd the OnClick event handler for the Login button to the code used in the custom user control.BAdd the OnClick event handler for the Login button to the code used in the Web Form where the control is added.CIn the Page_Load method of the Web Form, add a code segment to set the visibility of the TextBox and Button controls where the control is added.DIn the Page_Load method of the custom user control, add a code segment to set the visibility of the TextBox and Button controls.

考题 单选题You are testing an existing ASP.NET page. The page includes a text box. You are able to execute malicious JavaScript code by typing it in the text box and submitting. You need to configure the page to prevent JavaScript code from being submitted by the text box. In the @ Page directive, which attribute should you set to true?()A the EnableEventValidation attributeB the ResponseEncoding attributeC the ValidateRequest attributeD the Strict attribute

考题 单选题You create a Web Form that allows users to create a new account. You add a CreateUserWizard control by using the following code segment.You need to ensure that the wizard automatically sends an e-mail message to users when they finish creating their accounts. You add a valid element to the Web.config file. Which code segment should you add to the Page_Load event?()A Wizard1.RequireEmail = TrueB Wizard1.Email = user@address.comC Wizard1.MailDefinition.From = registration@mysite.comD SmtpMail.SmtpServer = mail.contoso.com

考题 多选题A JSP page needs to set the property of a given JavaBean to a value that is calculated with the JSP page. Which three jsp:setProperty attributes must be used to perform this initialization?()AIdBValCNameDParamEValueFProperty

考题 单选题Your web application views all have the same header, which includes the  tag in the  elementof the rendered HTML. You have decided to remove this redundant HTML code from your JSPs and put itinto a single JSP called /WEB-INF/jsp/header.jsp. However, the title of each page is unique, so you havedecided to use a variable called pageTitle to parameterize this in the header JSP, like this: 10.${param.pageTitle} Which JSP code snippet should you use in your main view JSPs to insert the header and pass thepageTitle variable?()A jsp:insert page=’/WEB-INF/jsp/header.jsp’. ${pageTitle=’Welcome Page’}. /jsp:insertB jsp:include page=’/WEB-INF/jsp/header.jsp’. ${pageTitle=’Welcome Page’}. /jsp:includeC jsp:include file=’/WEB-INF/jsp/header.jsp’. ${pageTitle=’Welcome Page’}. /jsp:includeD jsp:insert page=’/WEB-INF/jsp/header.jsp’. jsp:param name=’pageTitle’ value=’Welcome Page’ / . /jsp:insertE jsp:include page=’/WEB-INF/jsp/header.jsp’. jsp:param name=’pageTitle’ value=’Welcome Page’ / . /jsp:include

考题 单选题You have created a JSP that includes instance variables and a great deal of scriptlet code. Unfortunately,after extensive load testing, you have discovered several race conditions in your JSP scriptlet code. To fixthese problems would require significant recoding, but you are already behind schedule. Which JSP codesnippet can you use to resolve these concurrency problems?()A %@ page isThreadSafe=’false’ %B %@ implements SingleThreadModel %C %! implements SingleThreadModel %D %@ page useSingleThreadModel=’true’ %E %@ page implements=’SingleThreadModel’ %