A bean with a property color is loaded using the following statement <jsp:usebean id="fruit" class="Fruit"/> What happens when the following statement is executed. Select the one correct answer. <jsp:setProperty name="fruit" property="*"/> A.This is incorrect syntax of <jsp:setProperty/> and will generate a compilation error. Either value or param must be defined. B.All the properties of the fruit bean are initialized to a value of null. C.All the properties of the fruit bean are assigned the values of input parameters of the JSP page that have the same name. D.All the properties of the fruit bean are initialized to a value of *.
Using "*" in the "property" attribute of the setProperty tag will scan all request parameters, and try to set them in the bean (see JSP.5.2 jsp:setProperty> in the JSP specification). For example, let's say you have two request parameters : name=orange&taste=bitter. setProperty will try to call setName("orange") and setTaste("bitter") in the Fruit bean. If these properties do not exist, they'll be ignored.
Now, I don't like the phrasing of answer C. It implies that a form has been submitted. I would have written : C.All the properties of the fruit bean are assigned the values of request parameters that have the same name.