with the HttpServletRequest object, we can have the getRequestURL, which shows the ressource requested, but in my case I would like to know from where the request comes:
I tried also getRemoteAddr() and getLocalAddr() that prints my local IP, (as I am running glassfish and small webserver that talks to glassfish locally.
but the IP doesn’t show the full referer, that should be in my case
http://my.domain.com/wiki/aPage
from my IP I can resolve to http://my.domain.com, yet not the full url
Does this mean I need to send also “wiki/aPage” in the request, or I hope there is a better possibility?
thanks
You can read the
Referer headerof the request and get the value by usingrequest.getHeader("Referer");