Embedded Maps as arguments

2009-01-26 Thread Matthew Seaborn
As I have grid of checkboxes I am currently trying to use embedded maps as 
arguments in Struts 2, for example using

@CreateIfNull( value = true )
@Element( value = HashMap.class )
public MapInteger, MapInteger, Boolean getTestMap() {
return testMap;
}

Using

/testAction.action?testMap[1][2]=true

Although it places the value in the right place, it is always

ognl.noConversionPossible


This has been discussed here 
(http://www.nabble.com/struts2-map-of-maps-td18882730.html ) but with no 
resolution.

Has anyone one this successfully?



Matthew Seaborn
Software Architect
t+44(0) 208 484 0729
m  +44(0) 7949 465 142
e   matthew.seab...@performgroup.commailto:%3cyourname...@performgroup.com


[cid:image001.jpg@01C97FDD.15D48900]http://www.performgroup.com/
Sussex House
Plane Tree Crescent
London, TW13 7HE
United Kingdom
www.performgroup.comhttp://www.performgroup.com/



 [cid:image002.gif@01C97FDD.15D48900] http://www.omnisport.tv/ 
[cid:image003.gif@01C97FDD.15D48900] http://www.watchandbet.tv/






CONFIDENTIALITY - This email and any files transmitted with it, are 
confidential, may be legally privileged and are intended solely for the use of 
the individual or entity to whom they are addressed. If this has come to you in 
error, you must not copy, distribute, disclose or use any of the information it 
contains. Please notify the sender immediately and delete them from your system.

SECURITY - Please be aware that communication by email, by its very nature, is 
not 100% secure and by communicating with Perform Group by email you consent to 
us monitoring and reading any such correspondence.

VIRUSES - Although this email message has been scanned for the presence of 
computer viruses, the sender accepts no liability for any damage sustained as a 
result of a computer virus and it is the recipient’s responsibility to ensure 
that email is virus free.

AUTHORITY - Any views or opinions expressed in this email are solely those of 
the sender and do not necessarily represent those of Perform Group.

COPYRIGHT - Copyright of this email and any attachments belongs to Perform 
Group, Companies House Registration number 6324278.

Re: Embedded Maps as arguments

2009-01-26 Thread Jeromy Evans


On 27/01/2009, at 4:57 AM, Matthew Seaborn wrote:

As I have grid of checkboxes I am currently trying to use embedded  
maps as arguments in Struts 2, for example using


@CreateIfNull( value = true )
@Element( value = HashMap.class )
public MapInteger, MapInteger, Boolean getTestMap() {
return testMap;
}

Using

/testAction.action?testMap[1][2]=true

Although it places the value in the right place, it is always

ognl.noConversionPossible




Hi Matt,
I haven't tried this myself, but I'd take the following steps to try  
to isolate it:


 1. instantiate the empty map of maps yourself prior to the params  
getting set.  Erasure may be preventing OGNL from instantiating the  
inner map because it can't determine the type.


 2. I'd try quoting those numbers so it's unambiguous that it's  
addressing an entry and not an index.  Shouldn't matter though, but I  
don't trust it.