Click here to Skip to main content
15,886,422 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello

I have a webpage with a forms that when it submits, runs a servlet. In that servlet I need to know the webpage who calls the servlet. How can I do?

I´m using Java 8.

Thanks

What I have tried:

I try with several methods of HttpServletRequest, as getQueryString, getServletPath, getServletInfo, getContextPath, getRequestURI, getRequestURL, but neither of those returns the webpage. Most of them returns the name of the servlet, but not the webpage´s name that calls it.
Posted
Updated 3-Jul-18 9:51am

1 solution

Java
request.getHeader("referer");
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900