File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes For Mr. Rama Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "For Mr. Rama" Watch "For Mr. Rama" New topic

For Mr. Rama

Amitkumar Dhama
Ranch Hand

Joined: Feb 14, 2005
Posts: 56
This is from Head First jsp and Servlet page no. 360:

The standard action is
<jsp:useBean id =�person� type=�foo.Person� class=�foo.Employ�>
<jsp:setProperty name = �person� property=�*�/>

in the standard action the type is person and the object is of type Employee, according to me if we will do


it will not be accessible. It is written in the book that all the properties will be set by the container but how it will set all the properties if it not accessible.
Hi Mr. Rama

Thanks for your answer, it is clear to me, tomcat is typecasting it, that was the code generated by the tomcat now two questions are striking me right here...

I did post this ques before but I couldn�t get res from your side that�s why I am posting it again�.

First of all Thanks for your great response....

1. Will the other servers take care of it.....
2. What are the cases in which tomcat or other server will do automatic typecasting.....

If all the servers are taking care of it, then no need toremember the polymorphism.

Thanking in advance.....

SCJP 1.4, SCWCD 1.4, M.Tech(CSE)
M Rama
Ranch Hand

Joined: Mar 04, 2005
Posts: 91
Sorry, I didn't know the answer to your question and hence didnot post a reply. I will let you know if I find something in this same thread. My assumption is that this is specific behaviour only in JSP and particularly the method:

which I think is what is doing the property="*" .
I agree. Here's the link:
subject: For Mr. Rama
It's not a secret anymore!