struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DavidCAIT <>
Subject Null element in List<Integer>
Date Tue, 03 Feb 2009 16:10:50 GMT


I have a list of Integers and I want one of the options to be null (since it
is a search field). However, I get the following freemarker exception when
rendering my JSP:

>> FreeMarker template error!

>> Error on line 73, column 13 in template/simple/select.ftl
>> stack.findValue('top') is undefined.
>> It cannot be assigned to itemKey
>> The problematic instruction:
>> ----------
>>==&gt; assignment: itemKey=stack.findValue('top') [on line 73, column 13
in template/simple/select.ftl]
>>  in user-directive s.iterator [on line 63, column 1 in
>> template/simple/select.ftl]
>> ----------

I am using Struts 2.0.11 with the following action:

public class simpleAction implements Preparable {

// both myList and value have a public getter and setter
private List<Integer> myList = new ArrayList<Integer>();
private Integer value;

public String prepare() {

myList.add(null); // commenting out this line removes the runtime JSP
for (int i = 0; i < 60; i++) {
} } }

My JSP page:

<s:form action="anotherAction">
<s:select list="myList" />
<s:submit />

Does anyone have any ideas or workarounds about how I can include a null
entry in a list of integers without getting this freemarker exception?

View this message in context:
Sent from the Struts - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message