File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Display User's Login Name from Client Machine's Environment Variable Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "Display User Watch "Display User New topic
Author

Display User's Login Name from Client Machine's Environment Variable

Jean John
Greenhorn

Joined: Dec 21, 2010
Posts: 22

Hi,
I have a requirement to display the name of the user who enters my jsp page by getting the username from the client's environment variables. Is this possible to do in my jsp page using java/javascript?


For eg: if ABC is the user who clicks on the link, i need to display Welcome ABC.
if XYZ is the user who clicks on the link, i need to display Welcome XYZ.

I tried using but it displays the server machine's username and not the client machine's.
Please help.

Thanks,
Jean
Vicky Vijay
Ranch Hand

Joined: Apr 23, 2008
Posts: 123
Can your provide the below information,

Do you have login screen for your application ??

If yes,

You can access the User information from the User related tables

Bear Bibeault
Author and opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 50691

Jean John wrote:I tried using but it displays the server machine's username and not the client machine's.

Of course. Servlets and JSP execute on the server.



[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Jean John
Greenhorn

Joined: Dec 21, 2010
Posts: 22

I need to identify the user trying to login from his machine's environment variable(windows os) rather than asking the user to enter the information. Is that possible in jsp?
Jean John
Greenhorn

Joined: Dec 21, 2010
Posts: 22

Guru Vijay wrote:Can your provide the below information,

Do you have login screen for your application ??

If yes,

You can access the User information from the User related tables




I don't have a login screen.
I need to identify the user trying to login from his machine's environment variable(windows os) rather than asking the user to enter the information. Is that possible in jsp?

Thanks,
Jean
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 13842

Not in JSP, no. It runs on the server, as already mentioned in this thread, so naturally it couldn't get anything from the client system. However a signed applet would be able to access that data.
Ravi Majety
Ranch Hand

Joined: Feb 26, 2009
Posts: 59

Hi John,

Just check this weblink which might be useful your requirement.

http://spnego.sourceforge.net/

The above project useful to make use of windows authentication for webapplications.
 
IntelliJ Java IDE
 
subject: Display User's Login Name from Client Machine's Environment Variable
 
Threads others viewed
Problem with HttpSession in Struts2
hyperlink and message resources..
Reading password information from a text file.
Doubt regarding the cookies.
how to get remote user name in a jsp page?
IntelliJ Java IDE