Hi,
I have a "Map" returned from a java method to JSP.I want to add the
map to the Json Object. could you please help me in this regard.
DataBeanObject : userProfileBean ( UserProfileDataBean)
Map name= address
Key = addressBean (JavaBean object has name,nick name properties)
value = phone numbers (List)
The json object should look as follows :
{"addressbook": {"name": "Tony",
"nick name" :"Tom"
"phoneNumbers": [
"
619 332-3452",
"664 223-4667"
]
}
}
In the above example. The name,nickname,are to be retrieved from
JavaBean object (key of the map )and phonenumbers is list (value of
the map)
<json:object name="addressbook">
<json:property escapeXml="false" name="name" value="$
{
userProfileBean.address.key.name}"/>
<json:property escapeXml="false" name="nick name" value="$
{userProfileBean.address.key.nickName}"/>
<json:array name="phoneNumbers" var="phoneNumbers" items="$
{userProfileBean.address.value}">
<json:object>
<json:property name="phoneNumber" value="$
{phoneNumbers.phoneNumber}"/>
</json:object>
</json:array>
</json:object>
The Json object for the above code is created as below,
{"addressbook":{"name":"",
"nick name":"",
"phoneNumber":[]
}
Could you please tell me, where i went wrong in retrieving values?