What is the response output of this JSP page code snippet?

Click the Exhibit button.
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.example.Product class with a name property of
“The Matrix” and price property of 39.95.
Given the JSP page code snippet:
1. <jsp:useBean id=’product’ class=’com.example.Product’>
2. <jsp:setProperty name=’product’ property=’price’ value=’49.95’/>
3. </jsp:useBean>
4. <%= product.getName() %> costs <%= product.getPrice() %>
What is the response output of this JSP page code snippet?

Click the Exhibit button.
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.example.Product class with a name property of
“The Matrix” and price property of 39.95.
Given the JSP page code snippet:
1. <jsp:useBean id=’product’ class=’com.example.Product’>
2. <jsp:setProperty name=’product’ property=’price’ value=’49.95’/>
3. </jsp:useBean>
4. <%= product.getName() %> costs <%= product.getPrice() %>
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

Explanation:



Leave a Reply 0

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