Hi,
I've got the following setup:
pageA.jsp
<jsp:include page="pageB.jsp">
</jsp:include>
pageB.jsp
<@ include file="Header.jsp">
Header.jsp
<!-- print out a common page header -->
In the Header page, which is STATICALLY, included in pageB, which means
we're really only dealing with pageA and pageB, I want to determine the
name of pageB from the request (or response) object so that I can
customize the page header that I'm displaying. I hope this makes sense.
I've looked through the mailing list and the javadocs for a method that
will return me the information. That is I'm looking for some method
which will return "pageB.jsp" (or something similar) when called from
pageB.jsp and "pageA.jsp" when called from pageA.jsp but will return
"pageB.jsp" when called within pageB.jsp regardless of whether it is
invoked directly by the browser or it is included in pageA.jsp.
Unfortunately all the methods that I've tried all return info about
pageA.jsp, presumably because that is the one that is actually requested
from the client. I've tried the following methods:
request.getContextPath()
request.getPathInfo()
request.getPathTranslated()
request.getRequestURI()
request.getServletPath()
getServletContext().getRealPath(".")
These methods all return Strings related to pageA, regardless of whether
the methods are called from pageB.jsp which is dynamically included in
pageA.
So, my question is how can I find out the name of the current page being
processed. If I'm in pageB.jsp it should return "pageB.jsp" (or
something similar) regardless of whether pageB.jsp is invoked directly
from the client or indirectly through an include in pageA.jsp.
Thank you for your help.
Alex.
--
To unsubscribe: <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>