[jboss-user] [JBoss Portal] - Re: struggling to get user family name and role into jsp fil

jncrisp do-not-reply at jboss.com
Tue Mar 24 16:37:19 EDT 2009


Thanks apemberton for pointing me in the right direction!  

In Portal 2.7 it changed a little bit.  Here is what I did inside the jsp to get the first and last name:

<%
  | 		
  | UserProfileModule userProfileModule = (UserProfileModule) new InitialContext().lookup("java:portal/UserProfileModule");
  | 
  | UserModule userModule = (UserModule) new InitialContext().lookup("java:portal/UserModule");
  | 
  | User user = userModule.findUserByUserName(principal.getName());
  | 
  | String lastName = (String) userProfileModule.getProperty(user, User.INFO_USER_NAME_FAMILY);
  | 
  | String firstName = (String) userProfileModule.getProperty(user, User.INFO_USER_NAME_GIVEN);
  | 
  | %>

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4220752#4220752

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4220752



More information about the jboss-user mailing list