struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Kelley (JIRA)" <>
Subject [jira] Created: (WW-3120) <s: checkbox> returns boolean type to ParameterAware
Date Thu, 07 May 2009 16:08:30 GMT
<s: checkbox> returns boolean type to ParameterAware

                 Key: WW-3120
             Project: Struts 2
          Issue Type: Bug
          Components: Core Interceptors
    Affects Versions:
         Environment: Windows XP SP3, IE6 & Firefox 3.0.10, Apache Tomcat 5.5.17, Java
            Reporter: Jeff Kelley

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[].

<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;

        workorderUpload = parameterMap.get("MCN");

        return SUCCESS;

     public void setParameters(Map paramMap)
        parameterMap = paramMap;

When the execute() method runs I get a class cast exception 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,[Ljava.lang.String;@3a3e21, MCN=false, struts.token=[Ljava.lang.String;@9ac272,

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

View raw message