Do either RenderRequest.getRemoteUser() or RenderRequest.getUserPrincipal() get you the information you need? There is also RenderRequest.isUserInRole().
Thanks for the reply.
Unfortunately, RenderRequest.getRemoteUser and RenderRequest.getUserPrinciple wont do the job. I need the user's ID so I can look up information tied to that user (such as orders).
I'm comfortable using JBossPortlet, but I was hoping there was a better way that would not cause me to access the JBoss specific classes.
The information provided by RenderRequest.getRemoteUser is unique too, so if you just intend to identify related data, why not using this? Of course, it's not a number but this shouldn't matter.
Yes, your right. I hadn't thought of that.
But my question is more along the lines of what is the best practice? Is it possible to confine myself to the javax.portlet interfaces and get a user object. If not why? Is this a shortcoming of the portlet API or am I missing something?
If you want to go the JSR 168 way and being independent of any portal you have no choice but going with bvogt solution.
There is no User object that is defined by the spec. As he said, the username can act as an id.
In theory you could have a portal vendor that doesn't associate that username with an id number. (without talking about performance)
Thanks, that answers my question. I'm wondering why there is no user object in the Portlet spec. I guess that would then lead to a group object and so on.
But I think this is a question for another forum.
Thanks for the help!