Ashish Shrestha wrote:
>
> "Duffey, Kevin" wrote:
> >
> This is what you want:
> >
> > <%
> > String contextPath = request.getContextPath();
> > %>
> >
> > <%@ include file="<%= contextPath %>/path/header.inc" %>
> >
> > stuff..
> >
> > <%@ include file="<%= contextPath %>/path/footer.inc" %>
> >
>
> This is what you do:
>
> <%
> String contextPath = request.getContextPath();
> String headerPath = contextPath + "/path/header.inc";
> String footerPath = contextPath + "/path/footer.inc";
> %>
>
> <%@ include file="<%= headerPath %>" %>
> stuff
> <%@ include file="<%= footherPath %>" %>
>
> ------
> You cannot mix the <%= %> with a String.
You're right about not mixing expressions with static strings, but
what you suggest still doesn't work. The reason is that the
file attribute of the include directive doesn't accept expression
values.
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