Hi,

As per the JSP include sytanx you can use either the include-file-name in
quotes directly or you can give it as a variable within scriptlet tags but
not as a combination of both.

Try :

<% String file="xyz";
      String path = "/distributor/ytf/gatekeeperreports/";
      String location = path+file+".jsp";
%>
<jsp:include page="<%=location%>" flush="true"/>


Hope that helps.
Ritesh


----- Original Message -----
From: "Partha Ranjan Das" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 20, 2003 2:07 PM
Subject: How can I write a variable filename in jsp:include?


> Hi,
> I want to dynamically include a file using the jsp:include action.
>
> But when I use a java variable in jsp:include action, it does not include
> the file.
>
> e.g:
> <%
> String file="xyz";%>
> <jsp:include page="/distributor/ytf/gatekeeperreports/<%=file%>.jsp"
> flush="true"/>
>
> This is not working.
>
> Whereas when I write like this:
> <jsp:include page="/distributor/ytf/gatekeeperreports/xyz.jsp"
> flush="true"/>, it is working.
>
> Anybody knows what can be done so that this dynamic include works?
>
> Thanks in advance,
>
> Partha Ranjan das
> *********************************************************************
> Disclaimer: The information in this e-mail and any attachments is
> confidential / privileged. It is intended solely for the addressee or
> addressees. If you are not the addressee indicated in this message, you
may
> not copy or deliver this message to anyone. In such case, you should
destroy
> this message and kindly notify the sender by reply email. Please advise
> immediately if you or your employer does not consent to Internet email for
> messages of this kind.
> *********************************************************************
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
>
> Some relevant archives, FAQs and Forums on JSPs can be found at:
>
>  http://java.sun.com/products/jsp
>  http://archives.java.sun.com/jsp-interest.html
>  http://forums.java.sun.com
>  http://www.jspinsider.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".

Some relevant archives, FAQs and Forums on JSPs can be found at:

 http://java.sun.com/products/jsp
 http://archives.java.sun.com/jsp-interest.html
 http://forums.java.sun.com
 http://www.jspinsider.com

Reply via email to