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