There is often reason to find out which JSP called the servlet or JSP that is running. The file that directed the browser or client to the running servlet or JSP is called to as the referrer.
Your reason may be for security or authentication reason. You may have a servlet that can only be accessed by a particular JSP. If this is the case then you can quickly find out which JSP has forwarded to the servlet or JSP using
request.getHeader("Referer");
this is set by the browser in the request so you do not need to set it. Note: the incorrect spelling of Referer in the getHeader this is intentional and is an artefact of an initial error in the definition and has remained since.



