When the user (client) tries to get into the application by typing the URL, i need to get that machine's windows logged in username.
I have tried with System.getProperty("user.name") but when I access the application from some other machine (client) then this still shows username of logged in user on server. I want this is to be changed according to the client machine username every time.
And also I have tried with some JavaScript code, it only works on IE but we are using Firefox.
Kindly suggest the possible ways to work with all kind of browsers.
Application Details:
View: Struts
Application Framework: Spring 3.1.1
Application Server: jboss-6.1.0.Final
Server OS: CentOS 5
解决方案
If this is for an intranet application, you can look at using NTLM (older) or Kerberos (newer) authentication (aka integrated windows authentication).
If you're using Spring security, look at the kerberos extension, http://blog.springsource.org/2009/09/28/spring-security-kerberos/.