This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts No getter method problem

 
Bhau Kulkarni
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi:
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();
while(listIter.hasNext()){
String nextItem = (String) listIter.next();
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>
<%
}
%>
</html:select>
</td>
(edited by Cindy to turn off smilies)
[ March 03, 2003: Message edited by: Cindy Glass ]
 
friso dejonge
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic