Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

You need to add to your portlet.xml something like

Code Block
xml
xml
titleDeclaring 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
titleAccessing a user attribute from JSR-168 Java implementationjava
Map userInfo = (Map)request.getAttribute(PortletRequest.USER_INFO);
String surname = (String)userInfo.get("user.name.family");