Which two output the name of the product in the response?

A servlet sets a session-scoped attribute product with an instance of com.example.Product and forwards to a JSP. Which two output the name of the product in the response? (Choose two.)
package com.example;
public class Product{
private String name;
private double price;
public Product(){
this("Default",0.0);
}
public Product(String name,double price){
this.name=name; this.price=price;
}
public String getName(){
return name;
}
public setName(String name){
this.name=name;
}
public double getPrice(){
return price;
}
public void setPrice(double price){
this.price=price;
}
}
A. ${product.name}
B. <jsp:getProperty name="product" property="name" />
C. <jsp:useBean id="com.example.Product" />
<%= product.getName() %>
D. <jsp:getProperty name="product" class="com.example.Product" property="name" />
E. <jsp:useBean id="product" type="com.example.Product">
<%= product.getName() %>
</jsp:useBean>

Download Printable PDF. VALID exam to help you PASS.

Leave a Reply

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


The reCAPTCHA verification period has expired. Please reload the page.