Identifying JSPs request by Servlet


General J2EE: Identifying JSPs request by Servlet

  1. Identifying JSPs request by Servlet (2 messages)

    Hi All,
    I am sending request from 4-jsps to a single servelt and i want to redirect those requests.
    How can I identify a request which came from a specific JSP.

    i.e., 1.jsp,2.jsp,3.jsp,4.jsp are calling dopost() method of MyServlet.
    how come the servlet(MyServlet) knows this request came from 1.jsp?

    thanks in advance


    Threaded Messages (2)

  2. Referer[ Go to top ]

    Two ways:

    1) Use http referer header:

    2) Add it to your request:
    a) GET method:
    b) POST method: (in a form)
    <form method="POST" action="/servlet/DispatchServlet">
      <input type="hidden" value="1.jsp"/>
  3. Referer[ Go to top ]

    Thank you