• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

For Mr. Rama

 
Amitkumar Dhama
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
____________________________________________________________________
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=�*�/>
</jsp:useBean>:

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

person.getEmpid();

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.....
 
M Rama
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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="*" .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic