Try these codes in your JSP file
out.println(config.getServletContext().getServerInfo()+"</BR>");
out.println(request.getRequestURI()+ "<BR>");
out.println(config.getServletContext().getRealPath(request.getServletPath())
+"</BR>");
out.println("http://"+ request.getHeader("Host")+
request.getRequestURI() + "<BR>");
Hope this helps
J.Hu
-----Original Message-----
From: Nadler Paul [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 11, 2000 8:32 AM
To: [EMAIL PROTECTED]
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