diff --git a/core/src/main/resources/template/simple/checkboxlist.ftl b/core/src/main/resources/template/simple/checkboxlist.ftl index d3d944fb6..c96c3f57c 100644 --- a/core/src/main/resources/template/simple/checkboxlist.ftl +++ b/core/src/main/resources/template/simple/checkboxlist.ftl @@ -30,7 +30,7 @@ <#assign itemKey = stack.findValue('top')/> <#if parameters.listValue?exists> - <#assign itemValue = stack.findString(parameters.listValue)/> + <#assign itemValue = stack.findString(parameters.listValue)?default("")/> <#else> <#assign itemValue = stack.findString('top')/> @@ -52,4 +52,4 @@ <#else>   - \ No newline at end of file + diff --git a/core/src/test/java/org/apache/struts2/views/jsp/ui/CheckboxListTest.java b/core/src/test/java/org/apache/struts2/views/jsp/ui/CheckboxListTest.java index d7d8bcbbe..0485941f7 100644 --- a/core/src/test/java/org/apache/struts2/views/jsp/ui/CheckboxListTest.java +++ b/core/src/test/java/org/apache/struts2/views/jsp/ui/CheckboxListTest.java @@ -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(); diff --git a/core/src/test/resources/org/apache/struts2/views/jsp/ui/CheckboxList-1.txt b/core/src/test/resources/org/apache/struts2/views/jsp/ui/CheckboxList-1.txt index 7edb0d323..5b8a5b67b 100644 --- a/core/src/test/resources/org/apache/struts2/views/jsp/ui/CheckboxList-1.txt +++ b/core/src/test/resources/org/apache/struts2/views/jsp/ui/CheckboxList-1.txt @@ -5,5 +5,7 @@ + +