Stuart Maclean wrote:
>
> I want to include a static HTML file from within a JSP page. The file
> name is derived from a parameter to the JSP page. I can't get this to
> work:
>
> <jsp:include file="<%= request.getParameter( "FOO" ) %>.html"
> flush="true" />
>
> It seems that the expression is not parsed correctly within a jsp
> include action???
>
> I can get the desired functionality if I go from JSP to a servlet
> which uses the RequestDispatcher mechanism to do the include, but this
> is a pain needing the servlet to bridge the gap.
>
> I'm using Tomcat3.1 standalone, with JDK1.2, on WinNT.
>
> Any ideas anyone?? Thanks
You can't mix request-time attribute value syntax and literal strings in
an attribute value; use one or the other. Also, the attribute name is "page",
not "file". So try something like this instead:
<jsp:include page="<%= request.getParameter( "FOO" ) + ".html" %>"
flush="true" />
Hans
--
Hans Bergsten [EMAIL PROTECTED]
Gefion Software http://www.gefionsoftware.com
===========================================================================
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