I think this is a timing problem. The <%@ include ... > directive is
processed at JSP page translation time and the expression <%=
valueOfMyString %> is processed at request time (a later point in time).
As I understand it, a .jsp file is FIRST translated into a .java file
implementing the Servlet interface, THEN (later) the .java file is
translated into a .class file (by the Java compiler), and then FINALLY
(still later) the .class file is executed to handle an HTTP request. The
<%@ include ...> is done during the FIRST of these steps, but the <%=
...%> expression is only actually evaluated during the LAST of these
steps. In the first translation step, a Java program is being written,
largely boiler-plate, and the text from <%! ... %> declarations, <%= ...
%> expressions, and <% ... %> code fragments is inserted into that
program at appropriate places.
Hope this helps explain why what you want to do isn't working. More
information about what you are trying to accomplish might help. For the
for loop example in the body of your message, you could simply do the
includes inline, like
<%@include file= "something1.html" %>
<%@include file= "something2.html" %>
...
<%@include file= "something9.html" %>
Best wishes,
Bruce Conrad
-----Original Message-----
From: Arnaud Vandyck [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 27, 1999 8:22 AM
To: [EMAIL PROTECTED]
Subject: howTo <%@ include file = "<% valueOfMyString %>" %>
I try to include different pages with the same prefixe and suffixe but
with
a variable between:
for (int i=1; i<10; i++)
<%@include file= "something" + i + ".html" %>
HOW CAN I DO THAT?
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html