In page 360,
Given
<jsp:useBean id="person" type="foo.Person" class="foo.Employee">
<jsp:setProperty name="person" property="*"/>
</jsp:useBean>
In foo.Person we have "name" property & in foo.Employee we have "empID" property.
The request parameter names in the html are "name" and "empID".
The JSP handwriteen say's that
"I want you to iterate through the request parameters, and find any that matches this bean's
property names and set the value of the matching properties equal to the value of the corresponding request paramaeter."
My understanding of the above is that both the properties of the bean (name and empID)will be set.
Is it wright.
But in page 414 BULLET POINTS it says that
"If you specify a 'type'attribute in <jsp:useBean>,you can set properties in <jsp:setProperty> ONLY on properties of the 'type' ,but NOT on properties that exist only in the actual 'class' type."
since the type of <jsp:useBean> is foo.Person and since it contains only name property.
ONLY it will be set.empID will not be set.
Is it Wright.
PLEASE explain me.
satish
Given
<jsp:useBean id="person" type="foo.Person" class="foo.Employee">
<jsp:setProperty name="person" property="*"/>
</jsp:useBean>
In foo.Person we have "name" property & in foo.Employee we have "empID" property.
The request parameter names in the html are "name" and "empID".
The JSP handwriteen say's that
"I want you to iterate through the request parameters, and find any that matches this bean's
property names and set the value of the matching properties equal to the value of the corresponding request paramaeter."
My understanding of the above is that both the properties of the bean (name and empID)will be set.
Is it wright.
But in page 414 BULLET POINTS it says that
"If you specify a 'type'attribute in <jsp:useBean>,you can set properties in <jsp:setProperty> ONLY on properties of the 'type' ,but NOT on properties that exist only in the actual 'class' type."
since the type of <jsp:useBean> is foo.Person and since it contains only name property.
ONLY it will be set.empID will not be set.
Is it Wright.
PLEASE explain me.
satish