struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Newton <newton.d...@yahoo.com>
Subject Re: How to use <s:select/> Tag? thx
Date Tue, 02 Sep 2008 14:49:31 GMT
--- On Tue, 9/2/08, Mead Lai wrote:
> the Action has a ModelData:userList
> 
> private List <User> userList;
> for (int i = 0; i < 3; i++) {
>     user.setUserId(i + "i");        // userId (useless comments)
>     user.setEmail(i + "@user.com"); // email
>     userList.add(user);
> }
> 
> my tag in jsp is showed following:
> <s:select label="test" name="test" list="${userList}"
>           listKey="email" listValue="userId" required="true" />
> 
> but some error caused below:
> 
> tag 'select', field 'list', name
> 'assignEditor': The requested list key
> '$userList' could not be resolved as a
> collection/array/map/enumeration/iterator
> type. Example: people or people.{name} - [unknown location]
> 
> javax.servlet.ServletException: tag 'select', field
> 'list', name
> 'assignEditor':
> The requested list key '$userList' could not be
> resolved as a collection/array/map/enumeration/iterator
> type. Example: people or people.{name} - [unknown location]

Does userList have a publicly-accessible getter?

(There's also no reason to put the ${} around userList in the "list" attribute.)

Dave


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message