Use req.getHeader("REFERER") where req is the HttpRequest.
>
> "Beheshti, Reza" wrote:
>
> Thanks to all of you who responded, but I still can not get to the
original
> page URL!!! I tried both HttpUtils.getRequestURL() and req.getRequestURI()
from the
> servlet and BOTH of them just return the URL for the servlet NOT the page
> that the servlet was called from.
>
> Here is an example of what I need to do:
>
> If I call my servlet (Say www.xxx.com/servlet/MyServlet
> <http://www.xxx.com/servlet/MyServlet> ) from www.xxx.com/page1.jsp
> <http://www.xxx.com/page1.jsp> I need to be able to return to
> www.xxx.com/page1.jsp <http://www.xxx.com/page1.jsp> after I am done my
> processing in the servlet. Since several different URLs can
> call the same process in servlet, I need to be able to return to the
originating page.
> All the methods that I have tried so far, including the above mentioned
> ones, ALWAYS return the URL for the servlet (i.e.
> www.xxx.com/servlet/MyServlet <http://www.xxx.com/servlet/MyServlet> )
> instead of the originating .jsp page that I really need.
>
> I though about passing a parameter to the Servelt as to where
> to return to, but I was hoping that there is a way to find out where the
originating
> .jsp's URL is in the servlet that receives the request.
>
> Any other thoughts?
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JSP-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".