单选题A session-scoped attribute, product, is stored by a servlet. That servlet then forwards to a JSP page. This attribute holds an instance of the com.Company. Product class with a name property of “The Matrix” and price property of 39.95. Given the JSP page code snippet: What is the response output of this JSP page code snippet? ()A Default costs 0.0B Default costs 49.95C Default costs 39.95D The Matrix costs 0.0E The Matrix costs 49.95F The Matrix costs 39.95
单选题
A session-scoped attribute, product, is stored by a servlet. That servlet then forwards to a JSP page. This attribute holds an instance of the com.Company. Product class with a name property of “The Matrix” and price property of 39.95. Given the JSP page code snippet: What is the response output of this JSP page code snippet? ()
A
Default costs 0.0
B
Default costs 49.95
C
Default costs 39.95
D
The Matrix costs 0.0
E
The Matrix costs 49.95
F
The Matrix costs 39.95
参考解析
解析:
暂无解析
相关考题:
Exhibit:You are creating a composite control for capturing user address information in a Web application. You define a number of properties that the user can set at design time. You need to group these properties in the Properties dialog box. In addition, you need to ensure that when users click on a particular property, they receive a short explanation of that property. The properties are shown in the exhibit. Which two actions should you perform?()A. Attach the Category attribute class to the controls class definition. Set its value to UserAddress. Mark the class as public.B. Attach the Browsable attribute class to each property in the group. Set its value to True. Mark the property as private.C. Attach the Category attribute class to each property in the group. Set its value to UserAddress. Mark the property as public.D. Attach the Description attribute class to each property in the group. Set each value to a description of the given property.E. Attach the DefaultProperty attribute class to each property in the group. Set each value to a description of the given property.
You are creating a Windows Communication Foundation (WCF) service that accepts messages from clients when they are started. The message is defined as follows:[MessageContract] public class Agent { A. Add a MessageBodyMember attribute to the CodeName property and set the ProtectionLevel to Sign. Add a MessageBodyMember attribute to the SecretHandshake property and set the ProtectionLevel to EncryptAndSign.B. Add a DataProtectionPermission attribute to the each property and set the ProtectData property to true.C. Add an xmlText attribute to the CodeName property and set the DataType property to Signed. Add a PasswordPropertyText attribute to the SecretHandshake property and set its value to true.D. Add an ImmutableObject attribute to the CodeName property and set its value property to true. Add a Browsable attribute to the SecretHandshake property and set its value to false.
ClicktheExhibitbutton.Aservletsetsasession-scopedattributeproductwithaninstanceofcom.example.ProductandforwardstoaJSP.Whichtwooutputthenameoftheproductintheresponse?() A.${product.name}B.jsp:getPropertyname=productproperty=name/C.jsp:useBeanid=com.example.Product/%=product.getName()%D.jsp:getPropertyname=productclass=com.example.Productproperty=name/
YouhaveanewITmanagerthathasmandatedthatallJSPsmustberefactoredtoincludenoscritpletcode.TheITmanagerhasaskedyoutoenforcethis.Whichdeploymentdescriptorelementwillsatisfythisconstraint?() A.jsp-property-group.url-pattern*.jsp/url-pattern.permit-scriptingfalse/permit-scripting./jsp-property-groupB.jsp-config.url-pattern*.jsp/url-patternpermit-scriptingfalse/permit-scripting./jsp-configC.jsp-config.url-pattern*.jsp/url-pattern.scripting-invalidtrue/scripting-invalid./jsp-configD.jsp-property-group.url-pattern*.jsp/url-pattern.scripting-invalidtrue/scripting-invalid./jsp-property-group
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 by the servlet to the JSP;furthermore, that JSP uses a custom tag and must also process this information. This information mustNOT be accessible to any other servlet, JSP or session in the webapp. How can you accomplish this goal?()A、Store the data in a public instance variable in the servlet.B、Add an attribute to the request object before using the request dispatcher.C、Add an attribute to the context object before using the request dispatcher.D、This CANNOT be done as the tag handler has no means to extract this data.
A JSP page needs to instantiate a JavaBean to be used by only that page. Which two jsp:useBean attributes must be used to access this attribute in the JSP page?()A、 idB、 typeC、 nameD、 classE、 scopeF、 create
Assume a JavaBean com.example.GradedTestBean exists and has two attributes. The attribute name is oftype java.lang.String and the attribute score is of type java.lang.Integer. An array of com.example. GradedTestBean objects is exposed to the page in a request- scoped attribute called results. Additionally,an empty java.util.HashMap called resultMap is placed in the page scope. A JSP page needs to add the firstentry in results to resultMap, storing the name attribute of the bean as the key and the score attribute of thebean as the value. Which code snippet of JSTL code satisfies this requirement?()A、${resultMap[results[0].name] = results[0].score}B、c:set var="${resultMap}" key="${results[0].name}" value="${results[0].score}" /C、c:set var="resultMap" property="${results[0].name}" ${results[0].value}/c:setD、c:set var="resultMap" property="${results[0].name}" value="${results[0].score}" /E、c:set target="${resultMap}" property="${results[0].name}" value="${results[0].score}" /
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
In a JSP-centric shopping cart application, you need to move a client’s home address of the Customerobject into the shipping address of the Order object. The address data is stored in a value object classcalled Address with properties for: street address, city, province, country, and postal code. Which two JSPcode snippets can be used to accomplish this goal?()A、c:set var=’order’ property=’shipAddress’value=’${client.homeAddress}’ /B、c:set target=’${order}’ property=’shipAddress’value=’${client.homeAddress}’ /C、jsp:setProperty name=’${order}’ property=’shipAddress’ value=’${client.homeAddress}’ /D、c:set var=’order’ property=’shipAddress’jsp:getProperty name=’client’ property=’homeAddress’ / /c:storeE、c:set target=’${order}’ property=’shipAddress’jsp:getProperty name=’client’ property=’homeAddress’ / /c:set
A JSP page needs to instantiate a JavaBean to be used by only that page. Which two jsp:useBeanattributes must be used to access this attribute in the JSP page?()A、IdB、TypeC、NameD、ClassE、Yscope
A session-scoped attribute is stored by a servlet, and then that servlet forwards to a JSP page. Which threejsp:useBean attributes must be used to access this attribute in the JSP page?()A、idB、nameC、beanD、typeE、scope
A custom tag is defined to take three attributes. Which two correctly invoke the tag within a JSP page?()A、prefix:myTag a="foo" b="bar" c="baz" /B、prefix:myTag attributes={"foo","bar","baz"} /C、prefix:myTag jsp:attribute a="foo" b="bar" c="baz" /D、prefix:myTagjsp:attribute name="a"foo/jsp:attributejsp:attribute name="b"bar/jsp:attributejsp:attribute name="c"baz/jsp:attribute. /prefix:myTag
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?()A、IdB、ValC、NameD、ParamE、ValueF、Property
You are implementing an ASP.NET MVC 2 Web application that contains several folders. The Views/Shared/DisplayTemplates folder contains a templated helper named Score.ascx that performs custom formatting of integer values. The Models folder contains a class named Player with the following definition.Public Class Player Public Property Name As String Public Property LastScore As IntegerPublic Property HighScore As IntegerEnd Class You need to ensure that the custom formatting is applied to LastScore values when the HtmlHelper.DisplayForModel method is called for any view in the application that has a model of type Player. What should you do?()A、Rename Score.ascx to LastScore.ascx.B、Move Score.ascx from the Views/Shared/DisplayTemplates folder to the Views/Player/DisplayTemplates folder.C、Add the following attribute to the LastScore property. UIHint("Score")D、Add the following attribute to the LastScore property. Display(Name:="LastScore", ShortName:="Score")
You are creating a Windows Communication Foundation (WCF) service that accepts messages from clients when they are started. The message is defined as follows. [MessageContract] public class Agent { public string CodeName { get; set; }public string SecretHandshake { get; set; } } You have the following requirements: "The CodeName property must be sent in clear text. The service must be able to verify that the property value was not changed after being sent by the client. "The SecretHandshake property must not be sent in clear text and must be readable by the service. What should you do?() A、 Add a MessageBodyMember attribute to the CodeName property and set the ProtectionLevel to Sign. Add a MessageBodyMember attribute to the SecretHandshake property and set the protectionLevel to EncryptAndSign.B、 Add a DataProtectionPermission attribute to the each property and set the ProtectData property to true.C、 Add an XmlText attribute to the CodeName property and set the DataType property to Signed. add a PasswordPropertyText attribute to the SecretHandshake property and set its value to true.D、 Add an ImmutableObject attribute to the CodeName property and set its value property to true. Add a Browsable attribute to the SecretHandshake property and set its value to false.
单选题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?()Ajsp:include page=’/WEB-INF/jsp/header.jsp’jsp:param name=’pageName’ value=’Welcome Page’ / /jsp:includeBjsp:import page=’/WEB-INF/jsp/header.jsp’jsp:param name=’pageName’ value=’Welcome Page’ / /jsp:importCjsp:include page=’/WEB-INF/jsp/header.jsp’jsp:attribute name=’pageName’ value=’Welcome Page’ / . /jsp:includeDjsp:import page=’/WEB-INF/jsp/header.jsp’. jsp:attribute name=’pageName’ value=’Welcome Page’ / . /jsp:import
单选题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 by the servlet to the JSP;furthermore, that JSP uses a custom tag and must also process this information. This information mustNOT be accessible to any other servlet, JSP or session in the webapp. How can you accomplish this goal?()AStore the data in a public instance variable in the servlet.BAdd an attribute to the request object before using the request dispatcher.CAdd an attribute to the context object before using the request dispatcher.DThis CANNOT be done as the tag handler has no means to extract this data.
多选题A session-scoped attribute is stored by a servlet, and then that servlet forwards to a JSP page. Which threejsp:useBean attributes must be used to access this attribute in the JSP page?()AidBnameCbeanDtypeEscope
单选题You are implementing an ASP.NET MVC 2 Web application that contains several folders. The Views/Shared/DisplayTemplates folder contains a templated helper named Score.ascx that performs custom formatting of integer values. The Models folder contains a class named Player with the following definition.Public Class Player Public Property Name As String Public Property LastScore As IntegerPublic Property HighScore As IntegerEnd Class You need to ensure that the custom formatting is applied to LastScore values when the HtmlHelper.DisplayForModel method is called for any view in the application that has a model of type Player. What should you do?()ARename Score.ascx to LastScore.ascx.BMove Score.ascx from the Views/Shared/DisplayTemplates folder to the Views/Player/DisplayTemplates folder.CAdd the following attribute to the LastScore property. UIHint(Score)DAdd the following attribute to the LastScore property. Display(Name:=LastScore, ShortName:=Score)
单选题Assume a JavaBean com.example.GradedTestBean exists and has two attributes. The attribute name is oftype java.lang.String and the attribute score is of type java.lang.Integer. An array of com.example. GradedTestBean objects is exposed to the page in a request- scoped attribute called results. Additionally,an empty java.util.HashMap called resultMap is placed in the page scope. A JSP page needs to add the firstentry in results to resultMap, storing the name attribute of the bean as the key and the score attribute of thebean as the value. Which code snippet of JSTL code satisfies this requirement?()A${resultMap[results[0].name] = results[0].score}Bc:set var=${resultMap} key=${results[0].name} value=${results[0].score} /Cc:set var=resultMap property=${results[0].name} ${results[0].value}/c:setDc:set var=resultMap property=${results[0].name} value=${results[0].score} /Ec:set target=${resultMap} property=${results[0].name} value=${results[0].score} /
多选题In a JSP-centric shopping cart application, you need to move a client’s home address of the Customerobject into the shipping address of the Order object. The address data is stored in a value object classcalled Address with properties for: street address, city, province, country, and postal code. Which two JSPcode snippets can be used to accomplish this goal?()Ac:set var=’order’ property=’shipAddress’value=’${client.homeAddress}’ /Bc:set target=’${order}’ property=’shipAddress’value=’${client.homeAddress}’ /Cjsp:setProperty name=’${order}’ property=’shipAddress’ value=’${client.homeAddress}’ /Dc:set var=’order’ property=’shipAddress’jsp:getProperty name=’client’ property=’homeAddress’ / /c:storeEc:set target=’${order}’ property=’shipAddress’jsp:getProperty name=’client’ property=’homeAddress’ / /c:set
单选题You are creating a Windows Communication Foundation (WCF) service that accepts messages from clients when they are started. The message is defined as follows. [MessageContract] public class Agent { public string CodeName { get; set; }public string SecretHandshake { get; set; } } You have the following requirements: "The CodeName property must be sent in clear text. The service must be able to verify that the property value was not changed after being sent by the client. "The SecretHandshake property must not be sent in clear text and must be readable by the service. What should you do?()A Add a MessageBodyMember attribute to the CodeName property and set the ProtectionLevel to Sign. Add a MessageBodyMember attribute to the SecretHandshake property and set the protectionLevel to EncryptAndSign.B Add a DataProtectionPermission attribute to the each property and set the ProtectData property to true.C Add an XmlText attribute to the CodeName property and set the DataType property to Signed. add a PasswordPropertyText attribute to the SecretHandshake property and set its value to true.D Add an ImmutableObject attribute to the CodeName property and set its value property to true. Add a Browsable attribute to the SecretHandshake property and set its value to false.
单选题You are creating a Windows Communication Foundation (WCF) service that accepts messages from clients when they are started. The message is defined as follows:[MessageContract] public class Agent { public string CodeName { get; set; } public string SecretHandshake { get; set; }}You have the following requirements: The CodeName property must be sent in clear text. The service must be able to verify that the property value was not changed after being sent by the client. The SecretHandshake property must not be sent in clear text and must be readable by the service.What should you do?()AAdd a MessageBodyMember attribute to the CodeName property and set the ProtectionLevel to Sign. Add a MessageBodyMember attribute to the SecretHandshake property and set the ProtectionLevel to EncryptAndSign.BAdd a DataProtectionPermission attribute to the each property and set the ProtectData property to true.CAdd an xmlText attribute to the CodeName property and set the DataType property to Signed. Add a PasswordPropertyText attribute to the SecretHandshake property and set its value to true.DAdd an ImmutableObject attribute to the CodeName property and set its value property to true. Add a Browsable attribute to the SecretHandshake property and set its value to false.
多选题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
单选题You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. You add a ListBox control to the application. The ListBox control is data-bound to an instance of a custom collection class of the Product objects named ProductList. The number of items of the data-bound collection is fixed. However, users can modify the properties of each of the Product objects in the collection. You need to ensure that changes made on the Product objects are automatically reflected in the ListBox control. What should you do?()AImplement the INotifyPropertyChanged interface in the Product class.BImplement the INotifyCollectionChanged interface in the ProductList class.CSet the Mode property of the Binding object of the ListBox control to TwoWay.D Set the UpdateSourceTrigger property of the Binding object of the ListBox control to PropertyChanged.
多选题A JSP page needs to instantiate a JavaBean to be used by only that page. Which two jsp:useBeanattributes must be used to access this attribute in the JSP page?()AIdBTypeCNameDClassEYscope
多选题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