• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to i get IP address of the Remote system

 
Nag
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I have chat application.Based on my chat application,I want ot know the Which Browser,City,State and operating system of the customer.

Can soem one can help on this .

Thanks in advance

This is kind og urgent
 
Vinod K Singh
Ranch Hand
Posts: 198
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Servlet API provides a way to get the client IP address http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletRequest.html#getRemoteAddr(). To get the geographic location of the client there are some tools available, just try Google to find some.
 
Paul Clapham
Sheriff
Pie
Posts: 20208
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can often determine the type of browser from the User-Agent header in the request. Although people can and do forge that header to pretend that their code is a browser.
 
Gopikrishna Madishetti
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Request.getIPAddress() -- Returns A string containing the IP address of the client making the request.

response.write("IP Address: " + Request.getIPAddress());
 
Vinod K Singh
Ranch Hand
Posts: 198
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by krishna Madishetti:
Request.getIPAddress() -- Returns A string containing the IP address of the client making the request.


Krishna,

Can you please provide a source where this request.getIPAddress() method is mentioned, as I never came across such a method?
 
Gopikrishna Madishetti
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please find related artical using below link

http://support.dataweb.com/Help/default.view?Topic=objectmodel/request/request_getipaddress

thanks
 
Vinod K Singh
Ranch Hand
Posts: 198
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thats not a standard Java API.
 
Gopikrishna Madishetti
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yeah...you are right...
sorry for mis-information.
I think this is the correct way to get the remote ip address..
request.getRemoteAddr();
please let me know If I am wrong.
Thanks,
Krishna.
 
Soumik Basu
Ranch Hand
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i think the correct method is:
request.getRemoteUser();
 
Gopikrishna Madishetti
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) Interface HttpServletRequest,
getRemoteUser() -
Returns the login of the user making this request, if the user has been authenticated, or null if the user has not been authenticated.

2) Interface ServletRequest,
getRemoteAddr() -
Returns the Internet Protocol (IP) address of the client that sent the request.

Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic