request.getRemoteAddr with Ajax

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top