• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Getting ipv4 remote address from FacesContext

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I want the get a client's IP address from jsf. With a little search effort, I could come up with this:



Problem is, address is coming in ipv6 format. I searched around quite a bit and couldn't find any info on this. Is the address being returned as ipv6 because of network specific configurations or is JSF returning it as ipv6 by default?

If so, how do I tell JSF to return it as an ipv4 address?

Thanks in advance.
 
Lucas Piva
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Discovered the problem. Apparently, the server was running on a badly configured subnet or something. I started the server on another network and it worked fine.
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you may also want to check the http header for the referer ip if the ip can not be detected or is being proxied by a proxy that doesn't remove it , by reading the http header
reply
    Bookmark Topic Watch Topic
  • New Topic