cancel
Showing results for 
Search instead for 
Did you mean: 

get current user in toolarea (jsp page)

Former Member
0 Kudos

Hi

I try to retrive logged user in toolarea par (ToolAreaiView.jsp) with this code:

IUser user;

user= UMFactory.getAuthenticator().getLoggedInUser(request, response);

out.write(user.getName());

but I have error for request and response (object not found...)

This code is ok if I create a normal jsp page... but seems have problems when I use it in par project of tool area.

Thanks!

Andrea

Accepted Solutions (1)

Accepted Solutions (1)

Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos

Hi Andrea,

You say you can use it in the toolarea PAR but at the bottom you say you cannot use in the toolarea par. Do you mean if you create an abstractportalcomponent in the toolarea par?

In a JSP page, the request and response objects are automatically generated for you (implicit objects).

In an abstractportalcomponent, you have to define the nameso frequest and response in the docontent signature. Do you define it there?

Daniel

Answers (2)

Answers (2)

Former Member
0 Kudos

request.getUser().getName();

Former Member
0 Kudos

Hi

I now use:

componentRequest.getUser().getLogonUid()

and it works but...

I deploy, logon in portal like user A and my program retrive user A

Close browser, empty cache and cookies, logon in portal like user B and my program retrive user A...

If I redeploy it retrive the first user and maintaine it on next logon.

The same on other computers

Any ideas?

Thanks

Former Member
0 Kudos

Problem solved turning off cache of iView in portal administration.

Thanks to all

Andrea

Former Member
0 Kudos

Hi,

what about getting the:

request.getUser().getUniqueName();

Romano