Finding out your website visitor IP address in Java

后端 未结 4 1144
眼角桃花
眼角桃花 2021-01-25 06:05

Is there simple and reliable way to detect your website visitor IP address using Java. I am trying to make use of Akismet to detect spam on my blog post/comment. The API require

4条回答
  •  Happy的楠姐
    2021-01-25 06:48

    If you are using JSP on the server-side, then you can look at this link: http://www.rgagnon.com/javadetails/java-0363.html

    If you are using a servlet then you can use HttpServletRequest.getRemoteAddr()

提交回复
热议问题