I am having a lot of difficulty understanding how the html:select works - especially if you're working with different ypes of containers e.g. hashmaps, lists, collections. When using HashMaps, everything works fine but I'm having a lot of trouble with lists. Here's what I have (I'm building a struts application):
Action Class
List bdates = dbconfig.getBusinessDates(); httpServletRequest.getSession().setAttribute("BusinessDates", busDates );
I get an error saying no get property found for bdate in bean. So then I go to my ActionForm for this JSP page and add bdate as a string variable and its getter and setter functions. But it still doesnt work.
Can someone please explain to me how I can use a List with an Html:select and html ption tags in JSP? What am I missing?
remove the getter/setter from your ActionForm. your List contains a list of BusinessDate objects. what are the fields in this object? if you want to use property = 'bdate' for your html ptions this object must have a String bdate field with the setBdate() and getBdate() methods.
-/a<br />certified slacker...yes, my last name is 'do' - <a href="http://www.luckycouple.com" target="_blank" rel="nofollow">luckycouple.com</a>
Originally posted by Fallen Angel: i think that inside the html:select you need a logic:iterate - you then output the values using a bean:write nested inside a html ption tag.