I have spring MVC application, that runs in LAN. In there client machines IP addresses are changing time to time. Therefore I want to get client machines names(Their machine name is fixed ),because I want to get client machine's details without creating log in.
Is that possible to get client machine's name?? if it's possible how?? Or is there any other way to get that user details
Edit: codes I have tried so far
In HttpServlet
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
String hostname = request.getRemoteUser(); //this gives null
String hostname = request.getRemoteHost(); //This gives host machine name
}
Edit: reply to @Eugeny Loy In web.xml
<init-param>
<param-name>jcifs.smb.client.username</param-name>
<param-value>username</param-value>
</init-param>
In serverlet class
String username = config.getInitParameter("username");//This gives client IP address
I found the way to get client machine's name.