Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting currenlt y logged in user name using JAVA API ?

 
Nishant
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone tell me how to get the information of the logged in username using JAVA?
What I want to do is to make a HTML/JSP Web Page which will automatically take the windows authenticated username and display it on the second page when I press enter on the first page.
Thanks a lot
NA
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nishant,
Please change your name to be compliant with JavaRanch's naming policy.
Your displayed name should be 2 separate names with more than 1 letter each. We really would prefer that you use your REAL name.
You can change your name: here.
Thanks,
Cindy
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Many folks do not "log in" to Windows.
You would REALLY be restricting yourself - not only to ONLY Windows user, but only those that use that functionality.
 
Rodney Woodruff
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try
System.getProperty("user.name");
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic