开发者

ip address of user using java

Like to get the IP address and some other details for a web application. eg: lo开发者_运维知识库cation, language, country etc of the user using java.

I found one tool from sourceforge. Don't know whether it's good. java IP Locator


I recommend you try the GeoIP Java API by MaxMind. It is also used by Shareaza for torrent purposes.


If this is for a web application, try using ServletRequest#getRemoteAddr().

As for the location of the ip address, we're using Maxmind's GeoLite Country.

The browser language might be read from the request header.


Be aware that the IP address may be the IP of a proxy server, not the machine where the requests are ultimately coming from.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜