简体   繁体   中英

Client System Host Name is not captureing using request.getRemoteHost()

We are using request.getRemoteHost() in the jsp page to get the hostname of the client but it ll return only IP address of the client system

Is any other way to get the client system host name from java-script,jsp,...

If you server has enableLookups ( for example for Tomcat ) on false this getRemoteHost() will return only ip . Simplest solution would be to just change property and force resolving of ip to hostname.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM