How-to get the current username

Information about development with ProjX.

How-to get the current username

Postby Development@SIB » Wed Aug 17, 2016 1:22 pm

If you want to know the current user-name in your application, simply call:

Code: Select all
getApplication().getUserName();

The method returns the same as:

Code: Select all
getApplication().getConnection().getUserName();


If getApplication() return type is an IApplication, use this:

Code: Select all
((ProjX)getApplication()).getUserName();


Above code is client-side code. If you need the user-name on server-side, simply call:

Code: Select all
SessionContext.getCurrentSession().getUserName();
User avatar
Development@SIB
 
Posts: 311
Joined: Mon Sep 28, 2009 1:54 pm

Return to Documentation