File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Struts No getter method problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Struts No getter method problem" Watch "Struts No getter method problem" New topic

Struts No getter method problem

Bhau Kulkarni

Joined: Mar 03, 2003
Posts: 1
I have a html:select where the property name is being created at runtime using row number from database. I am getting a "No getter method found error". In the form bean I cannot code for the getter's and setters because the display is in a table format and I have to form the properties dynamically
A similar thing with html:text works fine.
Here is the piece of code that is giving me a problem. Any help will be appreciated.
<%colName = "methodType" + rownum;
<td><html:select property="<%=colName%>">
<html ption value = "<%=tempValueObj.getContactMethodTypeCd()%>"></html ption>
ContactDropDownSelects cdds = new ContactDropDownSelects();
HashMap tempMap = cdds.populateContactMethod();
ArrayList al = ( ArrayList ) tempMap.get("CONTACT_METHOD");
System.out.println("Size of al is " + al.size());
Iterator listIter = al.iterator();
String nextItem = (String);
StringTokenizer st = new StringTokenizer(nextItem,"~!");
String listCd = st.nextToken();
String listDesc = st.nextToken();
System.out.println("listcd is " + listCd);
<html ption value = "<%=listCd%>"><%=listDesc%></html ption>
(edited by Cindy to turn off smilies)
[ March 03, 2003: Message edited by: Cindy Glass ]
friso dejonge
Ranch Hand

Joined: Jul 11, 2002
Posts: 162
what you could do is create a string array/arraylist (whatever is possible for html selects) and place that as input in the option. This may not solve your problem, but it will seperate your html coding from the scripting.

swimming certificate (A & B), shoelaces diploma, and some useless java ones.
I agree. Here's the link:
subject: Struts No getter method problem
It's not a secret anymore!