Hi All,
I have just now upgraded from Struts 2.0.11 to struts 2.3.1.2 version and
running in to weird issue.
Basically, I have Object having HashMap holding HashMap. Something like
below :
public class TestVO {
private HashMap<String, HashMap> firstMap;
//I've setter/getter in real code but omitting here for simplicity.
}
My Action class goes as below :
public class MyAction extends ActionSupport {
public TestVO testVO;
public TestVO getTestVO() {
return this.testVO;
}
public void setTestVO(TestVO testVO) {
this.testVO = testVO;
}
public String execute() {
HashMap<String, HashMap> firstMap = new HashMap<String,
HashMap>();
HashMap<String, String> secondMap = new HashMap<String,
String>();
secondMap.put("FIRST_KEY", "firstValue");
secondMap.put("SECOND_KEY", "secondValue");
firstMap.put("KEY1", secondMap);
testVO.setFirstMap(firstMap);
return "success";
}
}
Now with above VO and class, I am doing below in my JSP and it is not
working after upgrade.
<s:property value="testVO.FirstMap.FIRST_KEY" />
Now above code was perfectly working fine with old struts 2.0.11 jar but
after upgrading this doesn't seem to be working.
I have tried doing <s:property value="testVO.FirstMap.['FIRST_KEY']" /> and
<s:property value="%{testVO.FirstMap.['FIRST_KEY]'}" /> but to no luck.
Am I missing something here ? Is there a different way to access Map of Map
with latest version ?
Please let me know if anyone has any idea.
Thank you.