on 05-17-2006 2:14 AM
Can someone tell me how to get current portal user In Web Dynpro Application.
Hi Robin,
Here is the code which would get the current portal user
IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
String userId = request.getUser().getUserId();
Hope this helps.
Cheers
Siva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Siva
Thanx for prompt reply!
But, How can I get the request in Web Dynpro Application. I can not find any API to get IPortalComponentRequest in Web Dynpro Application, I need your more and detail help and thanks a lot.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks SK.
I try and get currentUser with the codes you provide in Web Dynpro Application.
But when I deploy the Web Dynpro Application into a portal and running it in a portal, I will get null all the time.
Here is the codes in Component Controller:
public void wdDoInit()
{
//@@begin wdDoInit()
try
{
IWDClientUser user = WDClientUser.getCurrentUser();
String userName = user.getSAPUser().getUniqueName();
}
catch(Exception ex)
{
ex.printStackTrace();
wdComponentAPI.getMessageManager().reportException(ex.toString(), false);
}
//@@end
}
when running in portal , It always raise null Exception.
Hi SK:
I moved the codes into view Controller, and the same result I get.
the same codes in the view controllder:
public void wdDoInit()
{
//@@begin wdDoInit()
try
{
IWDClientUser user = WDClientUser.getCurrentUser();
String userName = user.getSAPUser().getUniqueName();
wdComponentAPI.getMessageManager().reportWarning("userName = " + userName);
}
catch(Exception ex)
{
ex.printStackTrace();
wdComponentAPI.getMessageManager().reportException("in View " + ex.toString(), false);
}
//@@end
}
Hi Saravanan:
Thanks for your answer.
But I wanna get a portal user from the Web Dynpro App, when it running in a portal.
And I try the codes like your answering. I can get "wong" when I run the Web Dynpro App individully, But I run it in the portal , I can get "".
So, I think in portal, with code "IWDClientUser user = WDClientUser.getCurrentUser();" we can get an user containing nothing. Any suggestion?
And thanks again.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.