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 a
Create jar which consist of applet where applet can get current user name by using System.getProperty("user.name")
write httpclient in same applet where it sends current user name to servlet which is on your server.
call current user method is applet
assign username to httpclient
send user name to servlet using httpclient
Your program give username of server not the client that's why you have to user client side technology like applet which resides in client machine.