File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Portals and Portlets and the fly likes Using Puma service in web application at WAS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Portals and Portlets
Bookmark "Using Puma service in web application at WAS" Watch "Using Puma service in web application at WAS" New topic

Using Puma service in web application at WAS

Ravi Kumar Ravuru
Ranch Hand

Joined: Apr 18, 2002
Posts: 176

Can I use the PUMA service for getting the logged in user information(portal) in the web application which is developed at Websphere Application Server?



Amit Ghorpade

Joined: Jun 06, 2007
Posts: 2716

"Ravi Kumar R.S " please check your private messages for an important administrative matter. You can check them by clicking the My Private Messages link above.

|Asking Good Questions|
Ayub ali khan
Ranch Hand

Joined: Oct 20, 2005
Posts: 380
Yes, you can check the below link for details on using PUMA service:

SCEA part I,TOGAF Foundation
Dipankar KumarGhosal

Joined: Nov 25, 2008
Posts: 9
No, you cannot use PUMA API to retrieve user info.

That is exactly where Servlets and Portlets differ.

Portlets provide us a way to retrieve the User info. Portal User Management Archictecture(PUMA) has been specifically there to provide you with features to access Logged in User Profile.

Here is an example :

private PumaUtil() {
try {
Context ctx = new InitialContext();
Object puma = ctx.lookup("portletservice/");
pumaService = (PortletServiceHome)puma;
pumaHome = (PumaHome)pumaService.getPortletService(PumaHome.class);
pumalocator = pumaHome.getLocator();
} catch (NamingException e) {
// TODO Auto-generated catch block
} catch (PortletServiceUnavailableException e) {
// TODO Auto-generated catch block
* This method returns the PumaProfile
* @return a PumaProfile object.
private PumaProfile getPumaProfile() {

return pumaHome.getProfile();

* This method will return the PumaController Objects
* @return
public PumaController getPumaController(){
return pumaHome.getController();

* This method will return the list of user attributes.
* @return list of User attributes
public List getLoggedInUserAttributes(){
List userAttr = new ArrayList();
try {
userAttr = getPumaProfile().getDefinedUserAttributeNames();
} catch (Exception e) {
logger.logError("Error while fetching the User Attribute Map from Portal Database:::" +
" Message:::" + e.getMessage());
return userAttr;

* This method will return the Map of user attributes.
* This map can be modified to update the attribute values for the user
* @return list of User attributes
public Map getLoggedInUserAttributeMap(){
Map userMap = new HashMap();
try {
userMap = getPumaProfile().getAttributes(getPumaProfile().getCurrentUser(), getLoggedInUserAttributes());
}catch (Exception e) {
logger.logError("Error while fetching the User from Portal Database:::" +
" Message:::" + e.getMessage());
return userMap;

Deboshree Roy

Joined: Oct 03, 2007
Posts: 21

I have a related problem in my application. I'm implementing the following code in jsp file to display the logged in user id on the top right in the application. But lately I have discovered that it displays the entire loginid inconsistently. Ex. if the login id is Deboshree Roy - LntInfotech, the application displays only Deboshree Roy only.But for id's which I have migrated into the application for them it displays the complete login id (Ex. Jon Tim - British Airways).
This is the code in my JSP file:

<%@ taglib uri="/WEB-INF/tld/portal.tld" prefix="wps" %>
<%@ taglib uri="/WEB-INF/tld/portal-internal.tld" prefix="wps-internal" %>
<%@ include file="../extension/TagLibInclude.jsp" %> <%-- This includes Extend/Express specific tag libraries. --%>
<%@page import="java.util.StringTokenizer"%>
<%@page import=""%>
<%@page import=""%>
<%@page import=""%>
<%@page import=""%>


<%@ include file="./Head.jsp" %>
String user_objid = "";
String strUser = null; portalUser= (;
if (portalUser != null) {

If anyone has successfully displayed loginid in a JSr 168 application on Portal 6.1 please do let me know.The application is integrated with LDAP to obtain the login details.
Sunil D Patil

Joined: Mar 30, 2009
Posts: 5
Take a look at this sample code that demonstrate how to use PUMA code in portal.

Starting from WPS 6.1 you can use JavaScript to access and modify (If your user repository is writable) User profile information. Take a look at for sample on how to do that.


IBM Certified WPS Developer 5.0,5.1,6.0,6.1
Manish Chhabra

Joined: Feb 24, 2010
Posts: 15

You can read the blog IBM Portal User Management Architecture (PUMA)

Manish Chhabra
I agree. Here's the link:
subject: Using Puma service in web application at WAS
Similar Threads
discarding database roundtrips
Removing User from Group Using PUMA API
webservices swings
Making my own servlet (for the first time...)
How to run Web Services at Tomcat