Which two create an instance of com.example.Product and initialize the name and price properties to the name and price request parameters?

Click the Exhibit button.
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.)

Click the Exhibit button.
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>

Explanation:



Leave a Reply 0

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