cancel
Showing results for 
Search instead for 
Did you mean: 

I'm getting the wrong username... from componentRequest.getUser();

Former Member
0 Kudos

Hi,

I am having an iView in top of all my web pages, and it was suppose to show the current loggded in username.

But it doesn't always show the correct name. Some times it shows a username, that I was logged in whith earlier.

The implementation is done like this:

IUserContext currentUser = componentRequest.getUser();
String user = currentUser.getLogonUid();

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Flemming,

your code looks good to me. Your problem sounds more like a caching issue actually. Make sure that your iView is not cached.

Hope this helps,

Esther

Former Member
0 Kudos

Hi Esther,

thanks, that seems to be exactly the problem.

I solved it now. The problem was that the CachingLevel was set to "Shared" which means that the iView is shared among users, and therefore cached.

I changed the CachingLevel to "User" so that it is specific for each user, and therefore not cached among users. I changed the variable in Portalapp.xml for the component that the iView is based upon.

Regards and thanks.

Answers (1)

Answers (1)

Former Member
0 Kudos

hi

good

Check this code.

Form myForm = this.getForm();

as well as sending the response to UWL.jsp.

Also I'm not sure if this will work:

UWLContext uwlContext = getUserContext(request);

I would prefer this:

UWLContext uwlContext = new UWLContext();

IUser user = componentRequest.getUser();

uwlContext.setUser(user);

check this link

/people/manish.chaitanya/blog/2007/01/08/flashy-uwl

thanks

mrutyun^