java获取客户端的计算机名称,如何在Java中获取客户端计算机上当前登录用户的用户名?...

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/.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值