Reputation:
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
Upvotes: 0
Views: 383
Reputation: 9914
You can read the Referer header
of the request and get the value by using request.getHeader("Referer");
Upvotes: 3