You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by MPF <ma...@procon.co.at> on 2007/07/10 11:57:16 UTC

How to get the ip address of the caller


HttpServletRequest servletRequest =
			(HttpServletRequest)
FacesContext.getCurrentInstance().getExternalContext().getRequest();
		String remoteHost = servletRequest.getRemoteHost();

thats the ip address of the caller?

best regards.
-- 
View this message in context: http://www.nabble.com/How-to-get-the-ip-address-of-the-caller-tf4054898.html#a11517927
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: How to get the ip address of the caller

Posted by Andrew Robinson <an...@gmail.com>.
http://www.exampledepot.com/egs/javax.servlet/GetClientInfo.html

Note that the IP will be that of the last NAT translation, so it
doesn't always represent the IP address of the physical computer. Most
firewalls use NAT translation to protect internal IP addresses.

On 7/10/07, MPF <ma...@procon.co.at> wrote:
>
>
> HttpServletRequest servletRequest =
>                         (HttpServletRequest)
> FacesContext.getCurrentInstance().getExternalContext().getRequest();
>                 String remoteHost = servletRequest.getRemoteHost();
>
> thats the ip address of the caller?
>
> best regards.
> --
> View this message in context: http://www.nabble.com/How-to-get-the-ip-address-of-the-caller-tf4054898.html#a11517927
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>
>