Author: tmjee Date: Tue Nov 7 08:37:43 2006 New Revision: 472155 URL: http://svn.apache.org/viewvc?view=rev&rev=472155 Log: WW-1494 - Java 5 Enum values are not handled properly by Radio jsp tag
Modified: struts/struts2/trunk/core/src/main/resources/template/simple/radiomap.ftl struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/RadioTest.java Modified: struts/struts2/trunk/core/src/main/resources/template/simple/radiomap.ftl URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/template/simple/radiomap.ftl?view=diff&rev=472155&r1=472154&r2=472155 ============================================================================== --- struts/struts2/trunk/core/src/main/resources/template/simple/radiomap.ftl (original) +++ struts/struts2/trunk/core/src/main/resources/template/simple/radiomap.ftl Tue Nov 7 08:37:43 2006 @@ -11,7 +11,7 @@ <#assign itemValue = stack.findString('top')/> </#if> <input type="radio" name="${parameters.name?html}" id="${parameters.id?html}${itemKeyStr?html}"<#rt/> -<#if tag.contains(parameters.nameValue, itemKeyStr)> +<#if tag.contains(parameters.nameValue, itemKey)> checked="checked"<#rt/> </#if> <#if itemKey?exists> Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/RadioTest.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/RadioTest.java?view=diff&rev=472155&r1=472154&r2=472155 ============================================================================== --- struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/RadioTest.java (original) +++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/RadioTest.java Tue Nov 7 08:37:43 2006 @@ -30,29 +30,28 @@ /** */ public class RadioTest extends AbstractUITagTest { - - public void testMapWithBooleanAsKey() throws Exception { - TestAction testAction = (TestAction) action; - - HashMap map = new LinkedHashMap(); - map.put(Boolean.TRUE, "male"); - map.put(Boolean.FALSE, "female"); - testAction.setMap(map); - - RadioTag tag = new RadioTag(); - tag.setPageContext(pageContext); - tag.setLabel("mylabel"); - tag.setName("myname"); - tag.setValue("%{'true'}"); - tag.setList("map"); - - tag.doStartTag(); - tag.doEndTag(); - - verify(RadioTag.class.getResource("Radio-3.txt")); - } - - + + public void testMapWithBooleanAsKey() throws Exception { + TestAction testAction = (TestAction) action; + + HashMap map = new LinkedHashMap(); + map.put(Boolean.TRUE, "male"); + map.put(Boolean.FALSE, "female"); + testAction.setMap(map); + + RadioTag tag = new RadioTag(); + tag.setPageContext(pageContext); + tag.setLabel("mylabel"); + tag.setName("myname"); + tag.setValue("%{true}"); + tag.setList("map"); + + tag.doStartTag(); + tag.doEndTag(); + + verify(RadioTag.class.getResource("Radio-3.txt")); + } + public void testMapChecked() throws Exception { TestAction testAction = (TestAction) action; testAction.setFoo("bar");