P
Perma
Hi,
I have two jsp pages; 1: main.jsp and 2: process.jsp
where main.jsp post some data to process.jsp via ajax to perform some
poll functionality.
In this poll, I wish to register the IP address of the user who uses
the poll. This I have intended to do by using the JSP function:
request.getRemoteAddr();
My question is:
will always request.getRemoteAddr() return the same address in both the
JSP's?
I would beleive that the remote address is the users IP in main.jsp
(since that is the page requested by the user), and that when main.jsp
calls process.jsp over ajax it would be main.jsp (localhost) which is
requesting the process.jsp, and therefore request.getRemoteAddr() would
return "localhost" or 127.0.0.1 when called from process.jsp.
Or would request.getRemoteAddr() allways return the IP adress of the
user requesting the data (even though it is processed via another
page)?
Hope someone could help me clarify this!
Regards, Per Magnus
I have two jsp pages; 1: main.jsp and 2: process.jsp
where main.jsp post some data to process.jsp via ajax to perform some
poll functionality.
In this poll, I wish to register the IP address of the user who uses
the poll. This I have intended to do by using the JSP function:
request.getRemoteAddr();
My question is:
will always request.getRemoteAddr() return the same address in both the
JSP's?
I would beleive that the remote address is the users IP in main.jsp
(since that is the page requested by the user), and that when main.jsp
calls process.jsp over ajax it would be main.jsp (localhost) which is
requesting the process.jsp, and therefore request.getRemoteAddr() would
return "localhost" or 127.0.0.1 when called from process.jsp.
Or would request.getRemoteAddr() allways return the IP adress of the
user requesting the data (even though it is processed via another
page)?
Hope someone could help me clarify this!
Regards, Per Magnus