Struts : Error in populating a Option List from Collection

A

Amol

posted August 03, 2003 03:59 AM
--------------------------------------------------------------------------------
Hi,
I am trying to populate a Collection (Arralist of my DTO object) in a
drop down box but it is giving be some error as
org.apache.jasper.JasperException: No getter method available for
property intDBID for bean under name DBList

This is my JSP Code in which I am trying to populate the collection

//JSP
<html:select property="intDBId">
<html ption value="0">Select a Dashboard</html ption>
<html ptions collection ="DBList" property= "intDBID" labelProperty
="strDBName"/>
</html:select>

//Action Class

public ActionForward execute (ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception
{


DBActionForm objForm=(DBActionForm) form;

AdminHelper objAdmHelper=new AdminHelper();

// Helper class which returns arraylist of DTO Objects
// after fetching dta from database
ArrayList arlDB=objAdmHelper.getDBList();

request.setAttribute("DBList",arlDB);

return mapping.findForward("success");

}

//BEAN Class

public class DBActionForm extends ActionForm
{
private int intDBId = 0;
private String strDBName = null;


public int getIntDBId() {
return intDBId;
}

public void setIntDBId(int intDBId) {
this.intDBId = intDBId;
}


public String getStrDBName() {
return strDBName;
}
public void setStrDBName(String strDBName) {
this.strDBName = strDBName;
}

};

// DTO Class
public class DBDTO implements Serializable, Cloneable {

// Member variables

private int intDBId= 0;
private String strDBName = null;

public DBDTO() { }

public int getIntDBId() {
return this.intDBId;
}

public void setIntDBId(int nDBId) {
this.intDBId = nDBId;
}

public String getStrDBName() {
return this.strDBName;
}

public void setStrDBName(String strDBName) {
this.strDBName = strDBName;
}
};

Still when i try to access the page it is giving this Error I donno
what is wrong with this.
Please help me i am a new to struts

Thanks

Amol....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top