Joshua,
To use a request-time value for jsp:include you need to do:
<jsp:include page='<%= basedir + "/includetxt.jsp" %>' />
i.e. the page parameter has to be either a string or a request-time
expression, you can't mix and match.
The single quotes are there so the double quotes won't confuse the parser.
Wes
Because this integrity cannot be altered, the guaranteed e-mail
of communication can be electronically.
On Wed, 3 Nov 1999, Joshua Lannin wrote:
> I am working on a project where I want to have a jsp file which includes
> content from various sub-directories. The site hierarchy looks like
>
> /includefile.jsp
> /Nietzsche/includetxt.jsp
> /Foucault/includetxt.jsp
> /Locke/includetxt.jsp
>
> So in the includefile.jsp I have a variable set called basedir, which refers
> to the base directory I would like to grab the includetxt.jsp file from. (ie
> String basedir="Nietzsche").
>
> The problem is that if I use the following command:
> <jsp:include page="<%=basedir %>/includetxt.jsp" />
>
> I get an error (running JRUN JSP 1.0 on Apache) "/home/httpd/html/Nietzsche"
> is a directory.
>
> This indicates to me that the '/includetxt.jsp' part of the include is not
> working.
>
> Is there a way to do this with the <%include file="filename" %> command? (I
> might have that syntax wrong).
> Could I still process a jsp which calls a database bean if I use this
> method?
>
> Right now I am having to do the following:
>
> <%String bdir = basedir + "/includetxt.jsp">
> <jsp:include page="bdir" />
>
> This works but isn't a desirable approach.
>
> Thanks!
> Josh
>
> ===========================================================================
> 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
>
===========================================================================
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