• Post Reply Bookmark Topic Watch Topic
  • New Topic

Track client request  RSS feed

 
zelynn goay
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. may i know how to track a client request (IP address of the client machine that make a request)? thanks.
 
Sripathi Krishnamurthy
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
javax.servlet.ServletRequest has 2 methods

1) getRemoteAddr()= Returns the Internet Protocol (IP) address of the client that sent the request
2) getRemoteHost()= Returns the fully qualified name of the client that sent the request. If the engine cannot or chooses not to resolve the hostname (to improve performance), this method returns the dotted-string form of the IP address
 
Joel McNary
Bartender
Posts: 1840
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
zeylnng:

Welcome to Java Ranch! Please take a moment to read theJava Ranch Name Policy and then change your display name to comply. (We are looking for a first and last name that is not obviously fictitious)

Thanks!
[ April 05, 2005: Message edited by: Joel McNary ]
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!