Fix Freemarker exception when model list entry has null value field

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@620838 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
René Gielen
2008-02-12 16:05:59 +00:00
parent a784fd662c
commit f88805221f
3 changed files with 6 additions and 3 deletions
@@ -30,7 +30,7 @@
<#assign itemKey = stack.findValue('top')/>
</#if>
<#if parameters.listValue?exists>
<#assign itemValue = stack.findString(parameters.listValue)/>
<#assign itemValue = stack.findString(parameters.listValue)?default("")/>
<#else>
<#assign itemValue = stack.findString('top')/>
</#if>
@@ -52,4 +52,4 @@
</@s.iterator>
<#else>
&nbsp;
</#if>
</#if>
@@ -140,7 +140,8 @@ public class CheckboxListTest extends AbstractUITagTest {
testAction.setFoo("hello");
testAction.setList(new String[][]{
{"hello", "world"},
{"foo", "bar"}
{"foo", "bar"},
{"baz", null}
});
CheckboxListTag tag = new CheckboxListTag();
@@ -5,5 +5,7 @@
<label for="foo-1" class="checkboxLabel">world</label>
<input type="checkbox" name="foo" value="foo" id="foo-2" title="mytitle" onchange="alert('foo');"/>
<label for="foo-2" class="checkboxLabel">bar</label>
<input type="checkbox" name="foo" value="baz" id="foo-3" title="mytitle" onchange="alert('foo');"/>
<label for="foo-3" class="checkboxLabel"></label>
</td>
</tr>