File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Concrete class problem in EL

 
Bobby Sharma
Ranch Hand
Posts: 598
3
Google App Engine jQuery Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Getters and Setters must follow the Java Beans naming rule.
empID -> setEmpID, getEmpID
or
empId -> setEmpId, getEmpId
 
Bobby Sharma
Ranch Hand
Posts: 598
3
Google App Engine jQuery Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well,I have solved my Problem.The problem was the same you told me.

thanks for the reply

best regards,
omi
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic