Instead of:
<%@ include file= "<%= barFile %>" %>
Try:
<jsp:include page="<%= barFile %>" flush="true"/>
The <jsp:include .../> tag has to be outside of any scriptlet <% ... %>
tags.
You are trying to do a server side static include. This is computed at first
compile of the JSP page. This is long before their is an actual request to
fetch parameters from. The JSP 1.x spec doesn't allow you to use the JSP
variables on this construct.
The second version is computed at each run of the servlet that the JSP
generates. This is when there is a http request and the include is dynamic.
The JSP 1.x spec allows you to use JSP variables when you are creating the
relative URL.
Hope this helps (and works, I haven't tested it).
-----Original Message-----
From: Julia Reynolds [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 04, 2000 9:38 AM
To: [EMAIL PROTECTED]
Subject: newbie seeks wisdom
I know this is a basic question: I'm new, have mercy!
I want to include jsp files with different url variables. I want to do
this:
String barFile = "catalogBar.jsp?catPg=" +
request.getParameter("catPg");
<%@ include file= "<%= barFile %>" %>
However, of course jsp is having none of this. Here's my error:
500 internal server error (fast becoming my new motto, by the way)
javax.servlet.ServletException: Parse Error in JSP page: The include
directive on line 23 The JSP page null's depedency '1' could not be
found.
allaire.jrun.jsp.ParseException: The include directive on line 23 The
JSP page null's depedency '1' could not be found.
How can I variabalize the url of the file to be included?
Julia
===========================================================================
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