Sneha Sharma@CONTEXT
07/11/2000 07:17 AM


Look into the class HttpUtils.There is a static method : getRequestURL.
    Use HttpUtils.getRequestURL(request) on the JSP.
     It reconstructs the URL the client used to make the request, using
information in the request object. The
     returned URL contains a protocol, server name, port number, and server
 path, but it does not include query string
     parameters.
Sneha




Nadler Paul <[EMAIL PROTECTED]> on 07/11/2000 09:32:00 AM

Please respond to A mailing list about Java Server Pages specification and
      reference <[EMAIL PROTECTED]>



 To:      [EMAIL PROTECTED]

 cc:      (bcc: Sneha Sharma/Context)



 Subject: Get the path and name of currently-running JSP









Folks -

I have a site in which JSPs call other JSPs, which often call other JSPs,
etc.,
all using <jsp:include...>. In this setting, how can any given JSP
determine its
own path and name, and the path and name of the JSP that called it?

I have tried request.getServletPath() and request.getHeader('REFERER'), but
they
only return the top-level calling JSPs.

Hint: Using the 'this' keyword, as in this.toString(), returns the full
name of
the current compiled class. This is a start, but is there a method I can
apply
to 'this' that will give me just the path and name of the JSP?

Thanks,

Paul
 **************************************************************************
The information contained herein is confidential and is intended solely
for the addressee(s).  It shall not be construed as a recommendation to
buy or sell any security.  Any unauthorized access, use, reproduction,
disclosure or dissemination is prohibited.

Neither SOCIETE GENERALE nor any of its subsidiaries or affiliates
shall assume any legal liability or responsibility for any incorrect,
misleading or altered information contained herein.
 **************************************************************************

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to