This example is from HFSJ.I follow this example and get exception
while I try to get value of empID of Concrete class Employee.
org.apache.jasper.JasperException: Cannot find any information on property 'empID' in a bean of type 'foo.Employee'
here is full example
package foo;
public abstract class Person{
private
String name;
public void setName(String name)
{
this.name=name;
}
public String getName()
{
return name;
}
}
-------------------
package foo;
public class Employee extends Person{
private int empID;
public void setEmpId(int empID)
{
this.empID=empID;
}
public int getEmpId()
{
return(empID);
}
}
----------------------
<html>
<body>
<form action="JspEL.jsp">
#ID <input type="text" name="empID">
name <input type="text" name="name"><br>
Done <input type="submit">
</form>
</body>
</html>
-------------------------------
<%@ page contentType="text/html; charset=UTF-8" %>
<
jsp:useBean id="person" type="foo.Employee" class="foo.Employee">
<jsp:setProperty name="person" property="name"/>
<jsp:setProperty name="person" property="empID"/>
</jsp:useBean>
<br>Name is : <jsp:getProperty name="person" property="name" />
<br> ID : <jsp:getProperty name="person" property="empID"/>
--------------------------------------------------------------
note:I am able to get name perfectly but the problem is empID.
I know you must have encountered this example on the book.