Hi.
I have to determine the client computer name from my wdp app, i'm using the InetAddress class from the JAVA's API as follows:
HttpServletRequest req = ((IWebContextAdapter) WDWebContextAdapter.getWebContextAdapter()).getHttpServletRequest();
String dirIP = req.getRemoteAddr();
byte[] hostAdd = new byte[4];
StringTokenizer st = new StringTokenizer(dirIP);
int i = 0;
while(st.hasMoreTokens()){
hostAdd<i> = (byte)(Integer.parseInt(st.nextToken(".")));
i++;
}
try{
InetAddress ia = InetAddress.getByAddress(hostAdd);
String host = ia.getHostName();
} catch(Exception e){}
It makes that the app works slowly and in some cases return the IP not the name.
I also try this:
HttpServletRequest req = ((IWebContextAdapter) WDWebContextAdapter.getWebContextAdapter()).getHttpServletRequest();
String host = req.getRemoteHost();
But i get the IP not the name.
Am i in the correct way?
How can i determine the user computer name?
Best Regards.
Gregory.