I deployed my servlet in server using tomcat. It basically have some input fields and save changes button. When someone writes something and click save I want to save changes to DB along with the PC name and logged user name of the client. Everything is done till updating PC name and Username of client. I can get PC name by InetAddress inetAddress = InetAddress.getByName(request.getRemoteAddr);String PCName = inetAddress.getHostName();
How can I get username? I tried many things such as request.getRemoteUser()
(returns null, request.getAuthType()
also returns null. How to change auth type?) and also tried System.getProperty("user.name")
(returns server username where as I need client username)
By username I mean the username by which logged in to PC.