on 09-14-2007 12:34 PM
Hi
We are developing an application in sap portal NetWeaver 2004s SPS 11 and need the client windows logged user and the machine hostname.
We have found the way to obtain the IP, this way
WDProtocolAdapter.getProtocolAdapter().getRequestObject().getClientHostAddress();
The method WDProtocolAdapter.getProtocolAdapter().getRequestObject().getClientHostName() returns the IP in the same way that the other method.
Somebody knows as I can obtain these parameters? Thanks beforehand
Hello,
Try the following to get the host
try {
IWDMessageManager msgMgr = wdComponentAPI.getMessageManager();
InetAddress n = InetAddress.getLocalHost();
String a = n.getCanonicalHostName();
String b = n.getHostAddress();
String c =n.getHostName();
String d = n.getLocalHost().toString();
msgMgr.reportSuccess("OS: " + System.getProperty("os.name"));
msgMgr.reportSuccess("CanonicalHostName: " + a);
msgMgr.reportSuccess("getHostAddress: " + b);
msgMgr.reportSuccess("getHostName: " + c);
msgMgr.reportSuccess("getLocalHost: " + d);
} catch (UnknownHostException e) {
e.printStackTrace();
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.