Hello Satish,
Page 360 of HFS is correct. The jsp:setProperty action, when used with property="*", will iterate over
all request parameters and attempt to set the property within the JavaBean, irrespective of the 'type' as declared in the jsp:useBean tag. The jsp:setProperty action uses introspection to find the setter methods for each request parameter; and introspection ignores the "declared type" of the object and deals directly with the "actual class" of the object. Make sense?
The penultimate (second to the last) bullet on page 414, is not correct.
However, that bullet is right in one respect that wasn't highlighted in the book. When the jsp:useBean action is used, the JSP page will now include a local variable in the generated service() method, which does follow polymorphic rules.
For example, the JSP code:
Is roughly equivalent to the following scriptlet code:
Notice that the declared type is the superclass, Person, but the created object is of type Employee.
What do you think this code would do?
If you guessed, that a compile-timer error is thrown, then you are correct.
Java "typing rules" are in effect even within a JSP page.
HTH,
Bryan
[ December 05, 2006: Message edited by: Bryan Basham ]