Multiple choice technology programming languages

A bean with a property color is loaded using the following statement Which of the following statements may be used to print the value of color property of the bean. Select the one correct answer.

  1. <jsp:getColor bean="fruit"/>

  2. <jsp:getProperty id="fruit" property="color"/>

  3. <jsp:getProperty bean="fruit" property="color"/>

  4. <jsp:getProperty name="fruit" property="color"/>

  5. <jsp:getProperty class="Fruit" property="color"/>

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

The standard JSP action to retrieve a property from a JavaBean is . It requires the 'name' attribute (matching the 'id' in useBean) and the 'property' attribute. Option 539806 correctly uses 'name' instead of 'id' or 'bean'.