• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Concrete class problem in EL

 
Ranch Hand
Posts: 598
3
jQuery Google App Engine Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
jQuery Google App Engine Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic