Versions Compared

Key

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

You need to add to your portlet.xml something like

Code Block
xmlxml
titleDeclaring a user attribute in portlet.xml
xml
<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

java
Code Block
java
titleAccessing a user attribute from JSR-168 Java implementation
java
Map userInfo = (Map)request.getAttribute(PortletRequest.USER_INFO);
String surname = (String)userInfo.get("user.name.family");