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] Closed: (WW-3120) <s: checkbox> returns boolean type to ParameterAware
Date Tue, 02 Jun 2009 14:22:42 GMT

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

Wes Wannemacher closed WW-3120.
-------------------------------

    Resolution: Won't Fix
      Assignee: Wes Wannemacher

To solve your problem, what you'd have to do is remove the checkbox interceptor from the interceptor
stack that is running against the affected action. 

I'm somewhat against making an attempt to fix this for 2.1.7 since it will likely affect compatibility,
and you can work around this by removing checkbox from the interceptor stack. I am going to
close this as "Won't Fix," but you can reopen if you really think we need to code around this.
To fix this, I would likely make the behavior configurable, but the default would be to continue
acting the way it does now. So, even with a fix, you are going to be forced to mess with your
interceptor stack configuration. 

> <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
>            Assignee: Wes Wannemacher
>             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