| hubert.chan@thrc-crhit.org 2007-11-29, 1:32 pm |
| We are running WebSphere Portal v6.0.1.1.<br />
<br />
Two JSR168 portlets, "alpha" and "beta", are part of different web modules. Both are on the same page and trying to get user attributes.<br />
<br />
However, whichever portlet gets the USERINFO object first prevents other JSR portlets on the page from using it. i.e., if portlet "alpha" loads first it gets the attributes fine, but "beta" gets NULL values, and vice versa.<br />
<br />
This code is part of the doView method in alpha's Java file:<br />
<blockquote>Map userInfo = (Map) request.getAttribute(javax.portlet.RenderRequest.USER_INFO); <br clear="all" /> String uid = (String) userInfo.get("uid"); <br clear="all" /> String userLang = (String) userInfo.get("preferredLanguage");</blockquote>
"uid" and "preferredLanguage" are defined in alpha's portlet.xml's User Attributes section.<br />
<br />
This code is part of beta's default view JSP:<br />
<blockquote>Map userInfo = (Map)renderRequest.getAttribute("javax.portlet.userinfo"); <br clear="all" /> String givenName = (userInfo!=null) ? (String)userInfo.get("user.name.given") : ""; <br clear="all" /> String sn = (userInfo!=null) ? (String)userInfo
.get("user.name.family") : "";</blockquote>
"user.name.given" and "user.name.family" are defined in beta's portlet.xml's User Attributes section.<br />
<br />
Note that the "Map userInfo" declarations are slightly different; the portlet modules were done by different people, but both work as long as they load first on a page.<br />
<br />
Can anyone tell me what I'm doing wrong? Is this a bug with Portal?<br />
<br />
Thanks!
|