Originally posted by jaya raj:
Hi,
How do I find the page where i am coming from in my current jsp page.
I have a page called registration.jsp where I would have to find whether I had from login page or some other link.
Please help me with this
Thank you
It depends on how you get there. If you get to the page through a forward, there are request attributes (in
Servlet 2.4/JSP 2.0) that hold URI information for the original request; if it's through an include, the request object still holds the original URI info; if it's through a redirect, the original info is typically lost (there's an HTTP header that may contain the info, but not always).
Your best bet is to let whatever gets you to the page include its URI in a request parameter (if its a redirect) or a request attribute (if it's a forward/include) and read the info from there in the registration.jsp file. That's what I do in the examples of a similar scenario in my book.