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

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


相似考题
更多“单选题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 ”相关问题
  • 第1题:

    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.

    正确答案:B

  • 第2题:

    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:set>
    • D、<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}" />

    正确答案:E

  • 第3题:

    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:store>
    • E、<c:set target=’${order}’ property=’shipAddress’><jsp:getProperty name=’client’ property=’homeAddress’ /> </c:set>

    正确答案:B,E

  • 第4题:

    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、id
    • B、name
    • C、bean
    • D、type
    • E、scope

    正确答案:A,D,E

  • 第5题:

    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、Id
    • B、Val
    • C、Name
    • D、Param
    • E、Value
    • F、Property

    正确答案:C,E,F

  • 第6题:

    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.

    正确答案:A

  • 第7题:

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


    正确答案: B
    解析: 暂无解析

  • 第8题:

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


    正确答案: A
    解析: 暂无解析

  • 第9题:

    多选题
    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:store>

    E

    <c:set target=’${order}’ property=’shipAddress’><jsp:getProperty name=’client’ property=’homeAddress’ /> </c:set>


    正确答案: E,A
    解析: 暂无解析

  • 第10题:

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


    正确答案: D
    解析: 暂无解析

  • 第11题:

    单选题
    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?()
    A

     Implement the INotifyPropertyChanged interface in the Product class.

    B

     Implement the INotifyCollectionChanged interface in the ProductList class.

    C

     Set 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.


    正确答案: B
    解析: 暂无解析

  • 第12题:

    多选题
    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

    Id

    B

    Val

    C

    Name

    D

    Param

    E

    Value

    F

    Property


    正确答案: F,B
    解析: 暂无解析

  • 第13题:

    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、 id
    • B、 type
    • C、 name
    • D、 class
    • E、 scope
    • F、 create

    正确答案:A,D

  • 第14题:

    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?() <title>

    • A、<jsp:include page=’/WEB-INF/jsp/header.jsp’><jsp:param name=’pageName’ value=’Welcome Page’ /> </jsp:include>
    • B、<jsp:import page=’/WEB-INF/jsp/header.jsp’><jsp:param name=’pageName’ value=’Welcome Page’ /> </jsp:import>
    • C、<jsp:include page=’/WEB-INF/jsp/header.jsp’><jsp:attribute name=’pageName’ value=’Welcome Page’ /> . </jsp:include>
    • D、<jsp:import page=’/WEB-INF/jsp/header.jsp’>. <jsp:attribute name=’pageName’ value=’Welcome Page’ /> . </jsp:import>

    正确答案:A

  • 第15题:

    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、Id
    • B、Type
    • C、Name
    • D、Class
    • E、Yscope

    正确答案:A,D

  • 第16题:

    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:myTag><jsp:attribute name="a">foo</jsp:attribute><jsp:attribute name="b">bar</jsp:attribute><jsp:attribute name="c">baz</jsp:attribute>. </prefix:myTag>

    正确答案:A,B,D

  • 第17题:

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

    正确答案:C

  • 第18题:

    单选题
    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:include>

    B

    <jsp:import page=’/WEB-INF/jsp/header.jsp’><jsp:param name=’pageName’ value=’Welcome Page’ /> </jsp:import>

    C

    <jsp:include page=’/WEB-INF/jsp/header.jsp’><jsp:attribute name=’pageName’ value=’Welcome Page’ /> . </jsp:include>

    D

    <jsp:import page=’/WEB-INF/jsp/header.jsp’>. <jsp:attribute name=’pageName’ value=’Welcome Page’ /> . </jsp:import>


    正确答案: A
    解析: 暂无解析

  • 第19题:

    多选题
    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

    id

    B

    name

    C

    bean

    D

    type

    E

    scope


    正确答案: D,B
    解析: 暂无解析

  • 第20题:

    单选题
    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:set>

    D

    <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} />


    正确答案: D
    解析: 暂无解析

  • 第21题:

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


    正确答案: D
    解析: 暂无解析

  • 第22题:

    多选题
    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

    Id

    B

    Val

    C

    Name

    D

    Param

    E

    Value

    F

    Property


    正确答案: C,B
    解析: 暂无解析

  • 第23题:

    多选题
    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

    Id

    B

    Type

    C

    Name

    D

    Class

    E

    Yscope


    正确答案: A,E
    解析: 暂无解析