Kevin Duffey wrote:
>
> Hi all,
>
> I imagine this isn't too uncommon...I have every jsp page include the same
> header and footer .inc file (I name them .inc to distinguish them as .inc
> files, and so that .jsp does not force any JSP processing on them when
> called upon). In the header, I use a table to break up the page into 3
> sections. The top is the navbar, the left is the informational pane, and the
> rest is the content area of the page including it. My header.inc looks like
> so:
>
> <html>
> <head>
> <title></title>
> </head>
> <body>
> <table width="100%" height="100%" cellspacing="0" cellpadding="0"
> border="0">
> <tr>
> <td colspan="2" width="100%" height="100" align="left" valign="top">
> <%@ include file="navbar.inc" %>
> </td>
> <td width="100" height="100%" align="left" valign="top">
> <%@ include file="left.inc" %>
> </td>
> <td width="100%" height="100%" align="left" valign="top">
>
> Now, in the footer.inc file included on every JSP page, I have:
>
> </td>
> </tr>
> </table>
> </body>
> </html>
>
> Both header.inc and footer.inc reside in www/include. Also, navbar.inc and
> left.inc reside in www/include as well. So, my problem is, in header.inc,
> where I inline include the navbar.inc, it works fine. But I am getting an
> error on the second include in the header.inc. Trying to include left.inc
> keeps telling me it cant find it at C:\www\left.inc" when really it should
> be showing c:\www\include\left.inc. If I put "/include/left.inc", it works
> fine. But then that doesn't make any sense. navbar and left are BOTH in the
> same dir, so how come an included file that includes other files sees the
> very FIRST include in the same dir its in, then after that it appears all
> included files must be relative to the root www dir?
The JSP 1.1 spec is vague about how relative paths in include directives
and include actions should be interpreted. This has been clarified in
JSP 1.2: a relative path should always be interpreted relative to the
page that contains the directive or action element.
So what you describe is (arguably) correct for a JSP 1.1 container (since
the spec is vague) but incorrect for a JSP 1.2 container.
I suggest you report this as a bug to the Orion team, since I believe
they claim to implement the preliminary JSP 1.2 specification.
> [...]
Hans
--
Hans Bergsten [EMAIL PROTECTED]
Gefion Software http://www.gefionsoftware.com
Author of JavaServer Pages (O'Reilly), http://TheJSPBook.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
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