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

NT User name of the client (IE) using JSP

 
ajay chaturvedi
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I need to get NT User name from the browser.
I do this using following line of ASP code.
request.servervariables("LOGON_USER")
How do i do this in JSP.
if it is not possible to get NT User name from JSP, how do i get from other source like JAVA API or something else
[ August 01, 2002: Message edited by: achaturvedi ]
 
Shawn Bayern
Author
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by achaturvedi:
Hi,
I need to get NT User name from the browser.
I do this using following line of ASP code.
request.servervariables("LOGON_USER")
How do i do this in JSP.
if it is not possible to get NT User name from JSP, how do i get from other source like JAVA API or something else

Remember, ASP is specific to Microsoft, so it gives you direct access to Microsoft-specific things, like the currently logged-in NT user. To do this portably in Java, you probably want to get the JVM's "current user", which you can do using the System property "user.name". That is, in JSP:
<%= System.getProperty("user.name") %>
Hope that helps,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic