You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Richard Sayre <ri...@gmail.com> on 2007/07/04 13:51:53 UTC
Populate s:select using Hasttable
I am trying to populate a s:select using a Hashtable.
<jsp:useBean id="sessionObject" scope="session" class="aps.UserSession" />
<jsp:useBean id="customer" scope="page" class="aps.Customer"
type="aps.Customer" />
<% customer.getCustomersForUser(sessionObject.getUserName()); %>
<s:form>
<s:select list="customer.customerList" />
</s:form>
The customer.getCustomersForUser() method populates a Hashtable called
customerList which has the appropiate get and set.
I assumed that calling customer.customerList in the 'list' attribute
would call the customer.getCustomerList which would return the
Hashtable.
When I try to execute the code I get the following error:
org.apache.jasper.JasperException: tag 'select', field 'list': The
requested list key 'customer.customerList' could not be resolved as a
collection/array/map/enumeration/iterator type. Example: people or
people.{name} - [unknown location]
org.apache.struts2.components.Component.fieldError(Component.java:231)
org.apache.struts2.components.Component.findValue(Component.java:293)
org.apache.struts2.components.ListUIBean.evaluateExtraParams(ListUIBean.java:79)
.
.
.
I verified that the Hashtable is getting populated with data. Is
there anything I am missing that needs to tell the select that I am
using a Hashtable?
Thank you,
Rich
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org