Direct Servlet Response to the Calling JSP

Discussions

Web tier: servlets, JSP, Web frameworks: Direct Servlet Response to the Calling JSP

  1. Direct Servlet Response to the Calling JSP (1 messages)

    When a JSP target the Servlet, How will you ensure that the response back from the servlet will target the JSP that invoked?


    Thanks for replying!
  2. You can tell which JSP targeted a servlet (through a hyperlink or form submission) by looking the HTTP "referer" header:

    String refererURL = request.getHeader("referer");

    This will be the URL of the page that invoked the servlet.