aspose file tools*
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
JavaRanch » Java Forums » Java » Servlets
Bookmark "Struts No getter method problem" Watch "Struts No getter method problem" New topic
Author

Struts No getter method problem

Bhau Kulkarni
Greenhorn

Joined: Mar 03, 2003
Posts: 1
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

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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Struts No getter method problem