on 09-18-2007 3:49 PM
Hello everyone,
we would like to implement a JSP page which will be embedded inside a Webdynpro IFrame . Inside this JSP we would like to get the current logon user to this application. In webdynpro, I know there are some APIs to get current logon user. Then how to get this information in a JSP file? or How to pass the informaiton from Webdynprot controller to a IFrame ?
Thanks in advance!
Best regards
Deyang
Hi,
Accessing the Logon ID
In EP5 you could simply call getUid() to obtain the logon ID. However, you will notice that this method is deprecated in EP6. This is primarily due to the fact that a user can be associated with multiple logon accounts. The Javadocs say to use getUniqueId() as a replacement for getUid(), but this returns a value that must be parsed to get the logon ID. You can access the actual logon ID by iterating through the IUserAccounts array obtained by calling getUserAccounts(). The logon ID is retrieved using the new call getLogonUid(). Often times you can simply pick the first element in the array:
String logonID = user.getUid();
IUserAccount accounts[] = null;
try {
accounts = user.getUserAccounts();
} catch (UMException e) {
response.write(("<br>Error getting accounts: " + e.getLocalizedMessage());
}
if (accounts != null) {
response.write("<br>Number of Login Accounts: " + accounts.length);
for (int i = 0; i < accounts.length; i++) {
response.write(
"<br>** Login ID #" + i
+ ": LogonUID=" + accounts<i>.getLogonUid()
+ ", AssignedUID=" + accounts<i>.getAssignedUserID());
response.write(
"<br>Last Login: "
+ accounts<i>.getLastSuccessfulLogonDate().toString());
response.write(
"<br># Logins: " + accounts<i>.getSuccessfulLogonCounts());
}
}
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
refer this link it may help you,
regards,
kanagaraj.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
How are you embedding your JSP in your Webdynpro view?
If possible pass the user parameter once you obtain it through api's to the JSP.
Then in your JSP you can access it via say
request.getParameter(user)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
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.