I am trying to display data info for each user by getting the user value which is already in the session but I keep getting this error.
Exception: Error looking up property "info" in object type "test.info". Cause: Property 'info' has no getter method
WHat am I doing wrong?
Exception: Error looking up property "info" in object type "test.info". Cause: Property 'info' has no getter method
WHat am I doing wrong?
Code:
//info.java
public class info {
public info(){
}
public Collection getinfo(String user) throws SQLException {
ArrayList list = new ArrayList();
String sql = "SELECT ADDR where USER= ?";
try {//connect statement
pstmt = con.prepareStatement(sql);
pstmt.setString(1, user);
rs = pstmt.executeQuery();
while(rs.next()) {
Infobean tsel = new Infobean(rs.getString("ADDR"));
list.add(tsel);
}
return list;
//Infobean.java
public class Infobean
{
private String ADDR;
private String user;
public Infobean(){
}
public Infobean(String ADDR, String user){
setAddr(Infobean);
setUser(user);
}
public String getAddr(){
return ADDR;
}
public String getUser(){
return user;
}
public void setAddr(String ADDR){
this.ADDR = ADDR;
}
public void setUser(String user){
this.user= user;
}
}
//.jsp file
<jsp:useBean id="test" class="info" scope="request"/>
<c:forEach items="test.info" var="x">
<td>${x.ADDR}</td>
</c:forEach>