Which two create an instance of com.example.Product and…

View the Exhibit.

Assume the product attribute does NOT yet exist in any scope. Which two create an instance of com.example.Product and initialize the name and price properties
to the name and price request parameters? (Choose two)

View the Exhibit.

Assume the product attribute does NOT yet exist in any scope. Which two create an instance of com.example.Product and initialize the name and price properties
to the name and price request parameters? (Choose two)

A.
<jsp:useBean id=”product” class=”com.example.Product” /> <jsp:setProperty name=”product” property=”*” />

B.
<jsp:useBean id=”product” class=”com.example.Product” /> <% product.setName( request.getParameter( “name” ) ); %> <% product.setPrice
( request.getParameter( “price” ) ); %>

C.
<jsp:useBean id=”product” class=”com.example.Product” /> <jsp:setProperty name=”product” property=”name”
value=”${param.name}” />
<jsp:setProperty name=”product” property=”price”
value=”${param.price}” />

D.
<jsp:useBean id=”product” class=”com.example.Product”> <jsp:setProperty name=”product” property=”name”
value=”${name}” />
<jsp:setProperty name=”product” property=”price”
value=”${price}” />
</jsp:useBean>



Leave a Reply 2

Your email address will not be published. Required fields are marked *