Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: how to send expando value/add-values in attribute Values jsonws api
Hi,
i am using api jsonws : http://localhost:8080/api/jsonws?contextName=&signature=%2Fexpandovalue%2Fadd-values-5-long-java.lang.String-java.lang.String-long-java.util.Map#serviceResults
companyId:20099
className : com.liferay.portal.kernel.model.User
tableName :CUSTOM_FIELDS
classPK: 34987
attributeValues: [{"companyId":20099,"className":"com.liferay.portal.kernel.model.User","tableName":"CUSTOM_FIELDS","classPK":366967,"attributeValues":"venu"},{"companyId":20099,"className":"com.liferay.portal.kernel.model.User","tableName":"CUSTOM_FIELDS","classPK":36967,"attributeValues":testtt}]
Error message :
please help out me
Thank you
Ram
i am using api jsonws : http://localhost:8080/api/jsonws?contextName=&signature=%2Fexpandovalue%2Fadd-values-5-long-java.lang.String-java.lang.String-long-java.util.Map#serviceResults
companyId:20099
className : com.liferay.portal.kernel.model.User
tableName :CUSTOM_FIELDS
classPK: 34987
attributeValues: [{"companyId":20099,"className":"com.liferay.portal.kernel.model.User","tableName":"CUSTOM_FIELDS","classPK":366967,"attributeValues":"venu"},{"companyId":20099,"className":"com.liferay.portal.kernel.model.User","tableName":"CUSTOM_FIELDS","classPK":36967,"attributeValues":testtt}]
Error message :
"java.util.HashMap cannot be cast to java.util.List; <--- java.lang.ClassCastException: java.util.HashMap cannot be cast to java.util.List"
how to send java.util.Map parametersplease help out me
Thank you
Ram
Hi Ram,
I've never actually tried this particular JSONWS before, but I'll give this one a shot. Currently in your code you are creating this --
but the attributeValues needs to be a map, so I think like this --
so if you change your logic to produce something like this --
Let me know if that works!
I've never actually tried this particular JSONWS before, but I'll give this one a shot. Currently in your code you are creating this --
{
"companyId": 20099,
"className": "com.liferay.portal.kernel.model.User",
"tableName": "CUSTOM_FIELDS",
"classPK": 366967,
"attributeValues": "venu"
}
but the attributeValues needs to be a map, so I think like this --
{
"companyId": 20099,
"className": "com.liferay.portal.kernel.model.User",
"tableName": "CUSTOM_FIELDS",
"classPK": 366967,
"attributeValues": {
...
}
}
so if you change your logic to produce something like this --
{
"companyId": 20099,
"className": "com.liferay.portal.kernel.model.User",
"tableName": "CUSTOM_FIELDS",
"classPK": 366967,
"attributeValues": {
"expando-field-name":"venue"
}
}
maybe it will work? I'm just going off of what I am seeing in the Expando API where it takes the Map<String, Serializable> and then does entry.getKey() and entry.getVaue() ... so I suspect your getKey() needs to return the custom field name that you configured and the value would be whatever you want to set it to.Let me know if that works!

Hi Andrew Jardine,
this is code {"Location":"abcd", "Contact":"79797998"}
it is working fine, thank you so much.
Reagrds
Ram
this is code {"Location":"abcd", "Contact":"79797998"}
it is working fine, thank you so much.
Reagrds
Ram
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™