Oliver Pereira wrote:
> Hi All,
>
> I have my include file in sub-directory say for eg 'dir1\dir2\xxx.jsp'
>
> and another jsp file yyy.jsp which resides in directory
> 'dir1\dir3\yyy.jsp'
>
> in my yyy.jsp i have a jsp include directive.
> <@include page = "../dir2/xxx.jsp">
>
> my jsp works perfectly. The problem is my path for xxx.jsp may change
> and instead of hard coding the path in my yyy.jsp, i need to store the
> path in a session/local variable and use it at run time.
>
> eg in yyy.jsp
>
> strpath = ' 'dir1\dir2\'
>
> <@include page = strpath + "xxx.jsp">
>
> when i try to do this i get an error. is there a way to do it ? please
> HELP.
The only way to have variable attributes in tags is to use <%= %> which resolves on
runtime.
Try: <jsp:include page="<%= strpath + "xxx.jsp %>"/>. Note: this will not work for
<@include> because jsp directives are processed before <%= %>.
--
Michael Hu, Paradox Team, Corel Corporation
===========================================================================
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