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

Struts No getter method problem

 
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 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 ]
 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic