• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Error in populating a Option List from Collection

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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....intDBIDDBList
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

[ August 06, 2003: Message edited by: Afifa Habchi ]
 
Afifa Habchi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello, You have to write all properties like this:
property= intDBId not intDBID
in your FormBean you have the method getIntDBId=> you have to take the Suffix intDBId without get,and the firt i musst be i not I.

This muss be made for all get and Set methods.
Afifa
 
What's wrong? Where are you going? Stop! Read this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic