diff --git a/core/src/main/resources/template/simple/checkboxlist.ftl b/core/src/main/resources/template/simple/checkboxlist.ftl index 9b005edfc..6f6619dde 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')/> 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 b7f4e2a28..af756d2da 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 @@ -134,7 +134,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 @@ + +