Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Get user by using screenname in liferay

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 1.66k
    Comment on it

    Hello Guys

    ScreenName is uniquely identify to user and we can use screenname as user tag name in liferay.

    Here, two ways to get user by using screenname with companyId :

    Step 1: Get user by using screenname in jsp(view.jsp) page in liferay portlet.

    long companyID = themeDisplay.getCompanyId();
    
    User user = UserLocalServiceUtil.getUserByScreenName(companyID, screenName);
    
    String UserName = user.getFullName();
    

    Step 2: Get user by using screenname in Prtlet class(Controller) in liferay portlet.

    long companyID = PortalUtil.getCompanyId(request)
    
    User user = UserLocalServiceUtil.getUserByScreenName(companyID, screenName);
    
    String UserName = user.getFullName();
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: