- Posted by: Santhosh Muktha
- Posted on: April 22 2004 01:20 EDT
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
1) Use http referer header: https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.36
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"/>