struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wes Wannemacher (JIRA)" <j...@apache.org>
Subject [jira] Updated: (WW-3120) <s: checkbox> returns boolean type to ParameterAware
Date Fri, 29 May 2009 20:35:42 GMT

     [ https://issues.apache.org/struts/browse/WW-3120?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Wes Wannemacher updated WW-3120:
--------------------------------

    Fix Version/s: 2.1.7

I will take a look and see if I can reproduce and fix before the 2.1.7 release, otherwise
I will bump this to 2.1.8

> <s: checkbox> returns boolean type to ParameterAware
> ----------------------------------------------------
>
>                 Key: WW-3120
>                 URL: https://issues.apache.org/struts/browse/WW-3120
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Interceptors
>    Affects Versions: 2.0.11.1
>         Environment: Windows XP SP3, IE6 & Firefox 3.0.10, Apache Tomcat 5.5.17,
Java 1.5.0_15
>            Reporter: Jeff Kelley
>             Fix For: 2.1.7
>
>
> My action class is implementing ParameterAware so I can get all the name/value pairs
on the page. When using the <s:checkbox> tag the value is a boolean in the ParameterMap,
not a String[].
> JSP:
> <s:checkbox name="MCN"  fieldValue="true" theme="simple"/>
> Action Class:
> public class Upload extends ActionSupport implements SessionAware, ParameterAware
> {
>      private Map<String, String[]> parameterMap;
>      public String execute()
>      {
>         String[] stuff;
>         stuff = parameterMap.get("MCN");
>         return SUCCESS;
>      }
>      public void setParameters(Map paramMap)
>     {
>         parameterMap = paramMap;
>     }
> }
> When the execute() method runs I get a class cast exception on 'stuff' since it cannot
cast from a boolean to a String[].
> When I debug the remote JVM with Eclipse 3.4 I get the following in the parameterMap
: {password=[Ljava.lang.String;@1e6ee98, struts.token.name=[Ljava.lang.String;@3a3e21, MCN=false,
struts.token=[Ljava.lang.String;@9ac272, uID=[Ljava.lang.String;@1c519e2}.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message