websphere-portalwcm

How to get logged in username in WCM JSP component page


I need to know if there is a way to get the logged in username in WCM JSP component in IBM Websphere Portal 8. I dont even know where to begin looking for this solution.


Solution

  • I believe you can get current username via

    request.getUserPrincipal().getName() 
    

    You can use Puma api as well to get more detailed user information.

    Example

    http://blog.manishchhabra.com/2011/05/ibm-portal-user-management-architecture-puma-spi/

    Javadoc

    http://public.dhe.ibm.com/software/dw/lotus/portal_javadoc/80/portal/spi_docs/index.html