
How to get the referer url in Java?
Thanks

Hi,
You can use the following line of code in your Servlet or JSP page:
String referrer = request.getHeader("referer");
System.out.println("referrer: " + referrer);
Thanks

hi friend,
To get the referer url in Java you can use the getHeader() method of HttpServletRequest interface. The argument of this method, in this case, must be a String "referer" like as
String refererUrl = request.getHeader("referer");
For detail tutorial please go through the link given below may this will be helpful for you.
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.