Search code examples
javajavascriptjsfjakarta-eeapplet

Is it possible to get client os user name in java web application?


i have website hosted on local server and this website is accessed by several local users, and i want when they access specific page to get the os user for the client/user accessing this page, when i tried the java code:

String currentUser=System.getProperty("user.name"); 

it gets the os user name for the server not the client.

please advise how to accomplish that, thanks.


Solution

  • using java method request.getRemoteUser() did the trick.