Taylor Gautier wrote:
>
> ----- Original Message -----
> From: Hans Bergsten <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, June 09, 1999 12:45 PM
> Subject: Re: How do you send them back to where they came from?
>
> > "Beheshti, Reza" wrote:
> > >
> > > Hi,
> > > I am relatively new to JSP and Servlet, so forgive me if this is a
> trivial
> > > question.
> > > I dogged thru the servelt API and did not find anything in "req" object
> > > where I can figure out the URL of the req.
> > > I need to be able to (in the servelet) figure out the origin URL of a
> > > request, so after I process the request in the servlet, I can send it
> > > back/redirect it to the same exact page/URL that it came from.
> >
> > If the information is available (no guarantees) it's available as the
> > "Referer" header, so req.getHeader("Referer") works.
>
> That is not correct.  The http header Referer is a back-link to a document
> that the user was in before visiting the current link.
>
> I think the intent of the poster was to retrieve the url that the user
> submitted to get to the current page (servlet), which, just like CGI, is
> available as either getPathInfo or getPathInfoTranslated.

Maybe you're right, I may have missed what the intent was. But if the
question is "how do I get the URL used to request the JSP page", then
the answer is actually getRequestURI. For a JSP page, the JSP processor
is mapped to the .jsp extension so getPathInfo and getPathInfoTranslated
returns null. See JSP 1.0 Appendix B for details.

> For a list of all available api's and their values, try out the SnoopServlet
> available in almost every servlet development kit.

--
Hans Bergsten           [EMAIL PROTECTED]
Gefion Software         http://www.gefionsoftware.com

===========================================================================
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".

Reply via email to