From custom header jsp - how to get the userid from sessionBean?

ling.lin shared this question 2 years ago
Answered

Hi - I'm trying to write a customized header for the yellowfin integration. I'm trying to get the userId for a logged in user. I can get the person full name.

SessionBean sb = (SessionBean)session.getAttribute(Const.SESSION_BEAN); String personFullName = sb.getPrsnBean().getFormattedFullName();

I know the Userid field is in the sessionBean sb object. Is there some function name or attribute name I can use to retrieve it? Let me know. Thanks,

-LL

Replies (1)

photo
1

Hi LL,

Thank you for your question. The getIpPerson() method will give you what you need. An example is below:

int personIP = sb.getPrsnBean().getIpPerson();
Please let me know if you have any further questions.

Cheers,

Neal

photo
1

Thanks Neal for the quick response, but ipPerson is a number. In my case it's 5. It's not what I was looking for. I'm looking for the userId or loginId, In my case it's "admin@yellowfin.com.au". I can see the following data is in my sessionBean.toString(). I just need a function or attribute to get it.

Userid :admin@yellowfin.com.au

-LL

photo
2

Hi LL,

Apologies for the misunderstanding. The code for this is:

String userId = sb.getUserid();
Please let me know if this is what you are after.

Cheers,

Neal

photo
1

Thank Neal - It worked.

-LL

photo
1

Great news!

Please do let us know if there is anything else we can help with.

Cheers,

Neal

photo
Leave a Comment
 
Attach a file