Hello dear people of Javanranch! Thank you for such a great supporting website for all the Java people, I'll be using it a lot.
My question is this:
I'm preparing for the scwcd and ran into something strange. On page 414 of Head First Servlets & JSP, the bullet list it says (2nd from the bottom) that with useBean, you can only set properties of the parent type, but under Tomcat (5.5.26-5) it seems you can also set class-subtype properties.
jsp:useBean id="pageBean" type="myParentBean" class="myBean"
The MyBean extends MyParentBean, but I can still set properties of the myBean class
jsp:setProperty name="pageBean" property="salary" value="100"
While salary is a property of myBean and not myParentBean. The editor gives me a warning about this, but Tomcat simply executes it.
What's the official rule here? Is Tomcat right in executing 'correctly'? Thanks in advance for any help.
My question is this:
I'm preparing for the scwcd and ran into something strange. On page 414 of Head First Servlets & JSP, the bullet list it says (2nd from the bottom) that with useBean, you can only set properties of the parent type, but under Tomcat (5.5.26-5) it seems you can also set class-subtype properties.
jsp:useBean id="pageBean" type="myParentBean" class="myBean"
The MyBean extends MyParentBean, but I can still set properties of the myBean class
jsp:setProperty name="pageBean" property="salary" value="100"
While salary is a property of myBean and not myParentBean. The editor gives me a warning about this, but Tomcat simply executes it.
What's the official rule here? Is Tomcat right in executing 'correctly'? Thanks in advance for any help.