Hi all this is Amit m preparing for the SCWCD 1.4....
I am having one doubt.
This is from Head First
jsp and
Servlet page no. 360:
Bean class is defined like
package foo;
abstract class Person{
private
String name = null;
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name
}
}
public class Employee extends Person{
private int empID = 0;
public void setEmpID(int empID)
{
this.empID = empID;
}
public int getEmpID()
{
return empID;
}
}
And 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.
Considering that input field in the HTML matches the property name:
Please let me know if I am wrong any where.
Thanking in advance.