Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

hoe to get remote ip address in jsf  RSS feed

 
tun zaw
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to get remote ip address from jsf pages.
And how to get from bean.
i use jsf and apache myfaces.
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'd do it the same way as you do with regular JSP's - get it from the HttpRequest object. The only difference is that you have to get the HttpRequest from the FacesContext, since it's not passed directly to the backing bean.

However, there are limits to the usefulness of having the requester's IP address - When NAT is in use, literally thousands of different requesters can appear to have the same IP address at the same time.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!