"Manty, George" wrote:
> It appears to me as though there is no way to do this. I think this
> functionality should be added to the JSP Spec.
>
It is, sorta ... see below.
>
> Right now, the only way it appears you can implement this is by hacking the
> JSP engine code and you can only do this if you are using an open source JSP
> engine.
>
> Anyone, have any other possible solutions?
>
The <%@ include file="..."%> directive is processed at the time your JSP page is
compiled, not when it is executed. Therefore, there is no opportunity for you to
calculate the name of the file to be included, because your scriptlet (or whatever)
isn't used until a request is made.
On the other hand, you can use <jsp:include> instead, for example:
<%
String pathname = "/page" + request.getParameter("page_number");
%>
<jsp:include page="<%= pathname %>" flush="true"/>
This works because <jsp:include> is processed at request time.
>
> Thanks,
> George
>
Craig McClanahan
===========================================================================
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