java - request.getRemoteAddr() returns null -


this question has answer here:

i developing application in local machine using tomcat 7 & servlet 3. in trying read client address in servlet identify request coming using request.getremoteaddr() returning null.

i tried metioned here , facing same issue. read using machine name instead of localhost resolve issue. tried using machine name still same issue.

can provide links or solution doc necessary configuration changes retrieve ip address ?

one of possibilities can getremoteaddr() can return null if request has been consumed, means response has been sent. has been noticed in tomcat 7

also fallback can check x-forwarded-for header calling getheader("x-forwarded-for") , see ip return.


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

android - CollapsingToolbarLayout: position the ExpandedText programmatically -

Listeners to visualise results of load test in JMeter -