Ken,
You will need to look at the CGI variables. There is a variable called
SCRIPT_NAME. You can access it by using request.getServletPath(). Do this
before you forward to the login page. You can pass this as a parameter in
the querystring or set a session variable or some other method that you
think of.
Hope this helps.
Tosh
-----Original Message-----
From: Ken Hammond [mailto:khammond@a...]
Sent: Tuesday, February 20, 2001 6:00 PM
To: Pro_JavaServer_Pages
Subject: [pro_jsp] JSP Forward & Return
I'm attempting to design an automated JSP forward-and-return feature. For
example, if a user browses to a page that requires a login, the page would
automatically forward to a login page. When login completed successfully,
the login page would forward to the original page.
I already have a forwarding mechanism that works nicely. It would also
serve this purpose if I could obtain the current URL before forwarding to
the login page.
My question is, how can one obtain the current URL using JSP? I know how
to do it with JavaScript, but I'd like to use a pure JSP approach if
possible.
Any ideas are appreciated.