You need to add to your portlet.xml something like
Code Block |
---|
| xml |
---|
| xml |
---|
title | Declaring a user attribute in portlet.xmlxml |
---|
|
<user-attribute>
<description>User Family Name</description>
<name>user.name.family</name>
</user-attribute>
|
...
Then from within your Portlet code you can access the values like this
Code Block |
---|
| java |
---|
| java |
---|
title | Accessing a user attribute from JSR-168 Java implementationjava |
---|
|
Map userInfo = (Map)request.getAttribute(PortletRequest.USER_INFO);
String surname = (String)userInfo.get("user.name.family");
|