Struts 2 select tag with values of a array list

The error

“The requested list key ‘departmentlist’ could not be resolved as a
collection/array/map/enumeration/iterator type. Example: people or
people.{name} – [unknown location] “

means that the select tag is not able to resolve departmentlist as a collection. It is an OGNL expression which is trying to find the departmentlist in the value stack and if it not found or contains a null reference the select tag will complain. When you render the select tag make sure the list is in the value stack and is initialized. See the example here.

Leave a Comment