I added a custom user field in Liferay, and set a value on a specific user.
How can I access this value programmatically?
If I try this, I always get null:
String customAttr = (String)user.getExpandoBridge().getAttribute("customAttr");
user.getExpandoBridge().getAttribute("customAttr") returns a value of Type java.IO.Serializable. Maybe the cast here is wrong?
But the Custom Attribute does exist (following code prints out the attribute key):
for (Enumeration<String> attrs = user.getExpandoBridge().getAttributeNames(); attrs.hasMoreElements();)
_log.info("elem: '" + attrs.nextElement() + "'");
Somehow I miss the point here....