struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gmail <rebeyond1...@gmail.com>
Subject Re: Re: How can I transfer parameters as Map type from jsp to action?
Date Wed, 06 Mar 2013 09:26:30 GMT
I know what's the problem, but I don't know why and how to resolve.

1. <input name="roleFunctionMap['aaa'].roleId" type="hidden" value="1">
2. <input name="roleFunctionMap['a-aa'].roleId" type="hidden" value="1">

The first can works, but the second fail.
The difference between the firs and the second is a minus.




Gmail

From: Gmail
Date: 2013-03-06 13:47
To: user@struts.apache.org
Subject: Re: Re: How can I transfer parameters as Map type from jsp to action?
Thanks for your reply.

I have input quotes around the string map key. But it does not work still.

<s:iterator value="roleFunctions" var="functionItem" status="status"> 
<input name='roleFunctionMap["${functionItem.functionId}"].roleId' type="hidden" value="${roleInfo.roleId}">
</s:iterator>




Gmail

From: Dave Newton
Date: 2013-03-06 11:35
To: Struts Users Mailing List
Subject: Re: How can I transfer parameters as Map type from jsp to action?
No quotes around the string map key?
 On Mar 5, 2013 10:32 PM, "Gmail" <rebeyond1218@gmail.com> wrote:

> My code is blow,
>
> action.java:
> public class RoleAction extends BaseAction {
> private Map<String, RoleFunctionRel> roleFunctionMap;
>
> public Map<String, RoleFunctionRel> getRoleFunctionMap() {
> return roleFunctionMap;
> }
>
> public void setRoleFunctionMap(Map<String, RoleFunctionRel>
> roleFunctionMap) {
> this.roleFunctionMap = roleFunctionMap;
> }
> }
>
> jsp:
> <s:iterator value="roleFunctions" var="functionItem" status="status">
> <input name="roleFunctionMap[${functionItem.functionId}].roleId"
> type="hidden" value="${roleInfo.roleId}">
> </s:iterator>
>
>
> when ${functionItem.functionId} is a int type number, the value can put
> into the map in action, but when it's a string can't.
>
> what's the problem?
>
>
>
>
> Gmail
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message