Win a copy of Mastering Non-Functional Requirements this week in the Design forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

To fetch windows username using jsp servlet  RSS feed

 
Aman Patel
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone I would like to get the windows username whoever clicks on the url of my web app, is it possible to get the username of the remote pc (client machine).
 
Yosuf Ibrahim
Ranch Hand
Posts: 87
2
Chrome Eclipse IDE Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

String username = System.getProperty("user.name");
 
Aman Patel
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi I had used this method it gives the server username and not clients username
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 36818
481
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aman,
No. That property is available to Windows, not to the browser. So the JSP/Servlet (which run on the server) don't have access to the Windows username.
 
Aman Patel
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi Jeanne is there any other way to get the windows username.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 36818
481
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aman Patel wrote:
Hi Jeanne is there any other way to get the windows username.

You could have the user type it in.

And some single sign on products have the ability to do this. However, the user has to install software on their windows machine so I don't think that counts as using jsp/servlet.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!