Javascript 访问JSON中的密钥

Javascript 访问JSON中的密钥,javascript,json,Javascript,Json,我将一个HashMap从Java端传输到Javascript端,我可以在Java端调试我的映射,也可以在浏览器控制台上查看 如果我写:console.log(responseFromServer[0].userAttributes) 但是当我试着写作的时候 console.log(responseFromServer[0].userAttributes['uid']); 或 我看到null 我错在哪里?我正在使用DWR,我错过了Java控制台上关于缺少转换器的错误 我将bean添加到dwr.x

我将一个HashMap从Java端传输到Javascript端,我可以在Java端调试我的映射,也可以在浏览器控制台上查看

如果我写:
console.log(responseFromServer[0].userAttributes)

但是当我试着写作的时候

console.log(responseFromServer[0].userAttributes['uid']);

我看到
null


我错在哪里?

我正在使用DWR,我错过了Java控制台上关于缺少转换器的错误

我将bean添加到dwr.xml:

<dwr:convert type="bean" class="com.entity.OrganizationAttributeValue"/>


可能存储在
userAttributes.uid中的数组包含字符串或值
null
?因为我们不知道这些数据,所以我们无能为力。这与JSON无关。顺便说一句,您有一个普通的JavaScript对象。在这里发布一个
responseFromServer
的示例。还包括如何在JavaScript中请求数据。
console.log(responseFromServer[0].userAttributes.uid);
<dwr:convert type="bean" class="com.entity.OrganizationAttributeValue"/>