用户个人资料信息
我试图在我的 portlet(部署在 JBoss GateIn 中的 JSR 286 portlet)中获取用户信息,
Map userInfo = (Map) request.getAttribute(PortletRequest.USER_INFO);
但我什么也没得到。我的 portlet.xml 有以下参数:
<user-attribute>
<description>User Name</description>
<name>user.name</name>
</user-attribute>
<user-attribute>
<description>User Id</description>
<name>user.id</name>
</user-attribute>
GateIn 提供 PortalRequestContext,它提供 getRemoteUser() 方法来获取登录用户的 ID。然后,OrganizationService 可以使用此 id 来获取 User,但这都是特定于 GateIn 的,而不是按照 JSR286 标准。 JSR 286 规定可以从 PortletRequest.USER_INFO 获取用户相关属性,如上所述。请指导。
提前致谢!
Ps:JBoss社区上的类似帖子 http://community.jboss.org/message/425683#425683< /a>
I am trying to fetch user info in my portlet (JSR 286 portlet deployed in JBoss GateIn) like
Map userInfo = (Map) request.getAttribute(PortletRequest.USER_INFO);
but I get nothing back. My portlet.xml has following params:
<user-attribute>
<description>User Name</description>
<name>user.name</name>
</user-attribute>
<user-attribute>
<description>User Id</description>
<name>user.id</name>
</user-attribute>
GateIn provides PortalRequestContext which gives getRemoteUser() method to get logged in user's id. This id can then be used by OrganizationService to get User but thats all GateIn specific and not as per JSR286 standard. JSR 286 states that user related attributes can be fetched from PortletRequest.USER_INFO as mentioned above. Please guide.
Thanks in advance!
Ps: Similar post on JBoss community http://community.jboss.org/message/425683#425683
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你的名字 id 是不同的,根据规范,它是这样的,
下面是更多(只是其中的一部分)..你可以从 jsr286 规范中获取完整列表
your name ids are different, according to the spec it is something like,
below are more(just part of it)..you can get the full list from jsr286 spec