Is it possible to get client os user name in java web application?

前端 未结 3 953
迷失自我
迷失自我 2020-12-21 22:41

i have website hosted on local server and this website is accessed by several local users, and i want when they access specific page to get the os user for the client/user a

3条回答
  •  执笔经年
    2020-12-21 23:27

    Create jar which consist of applet where applet can get current user name by using System.getProperty("user.name") write httpclient in same applet where it sends current user name to servlet which is on your server.

    1. call current user method is applet

    2. assign username to httpclient

    3. send user name to servlet using httpclient

    Your program give username of server not the client that's why you have to user client side technology like applet which resides in client machine.

提交回复
热议问题