| Author |
ipaddress in servlets
|
santosh akella
Ranch Hand
Joined: Oct 24, 2004
Posts: 32
|
|
hi i have a login page developed in servlets.. i want the IPADDRESS of the user u calls this servlet can it be possible how can this be done?? thank u
|
 |
Frederic Filiatrault
Ranch Hand
Joined: Jul 12, 2004
Posts: 69
|
|
Hi ! Sure ! Here it is:
javax.servlet Interface ServletRequest public java.lang.String getRemoteAddr() Returns the Internet Protocol (IP) address of the client or last proxy that sent the request. For HTTP servlets, same as the value of the CGI variable REMOTE_ADDR. Returns: a String containing the IP address of the client that sent the request
|
F.<br />SCJP, SCJD, SCWCD, SCBCD<br /> <br />Failure is not an option... It comes with the software bundle.
|
 |
santosh akella
Ranch Hand
Joined: Oct 24, 2004
Posts: 32
|
|
thank u i got it .... well i want all the information passed by the user and create an XML file for passing this information to another server . how can i do this. thank u once again
|
 |
Frederic Filiatrault
Ranch Hand
Joined: Jul 12, 2004
Posts: 69
|
|
It goes back to HTTP request. All the info you received from the request are the only you can use. Look at the ServletRequest interface and HttpServletRequest. Does interface/classes will give you all the info that you can obtain from the client. It makes sense, no ? thk !
|
 |
 |
|
|
subject: ipaddress in servlets
|
|
|