You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Eman Fattouh <em...@menanet.net> on 2002/12/12 14:47:59 UTC

need help urgently

dear all;
     i have some applications under webapps folder. all of them must include some static html files. the problem is if i jave the following file system:
 /var/tomcat4/webapps/test1 ------> application 1 containing test1.jsp file and others
 /var/tomcat4/webapps/test2 -------> application 2
 /var/tomcat4/webapps/includes ----> folder containing only html static files, not an application , for example: topfile.htm

how to refer to these static files (inside includes) from my jsp?
for example, when i refer to topfile.htm from test1.jsp as follows:
<jsp:include page="../includes/topfile.htm" flush="true"/>
the page is loaded balnk. why?

is it not allowed to refer to any folder outside my application? if so, how to work around that?
Regards
Iman

Re: need help urgently

Posted by Kris Schneider <kr...@dotech.com>.
<jsp:include> is limited to "...the inclusion of static and dynamic resources in
the same context as the current page." But, since it looks like you're using TC
4.x, you can take advantage of JSTL to include content from a different context
within the same container or even from an absolute URL. For example (different
context, same container):

<c:import url="/topfile.htm" context="/includes"/>

See:
http://java.sun.com/products/jsp/jstl/index.html
http://jakarta.apache.org/taglibs/doc/standard-doc/intro.html

Quoting Eman Fattouh <em...@menanet.net>:

> i'm appreciating your response, but are u sure that there is no another
> solution? i can't use links as these files are the banner and footer of the
> site, so i have to use jsp:include tag..
> all that i want to make sure..is it really not permitted to refer to any
> static resources outside my webapplication?
> if it is possible.. how to?
> 
> ----- Original Message -----
> From: "Aleksandr Shneyderman" <al...@law.columbia.edu>
> To: "Tomcat Users List" <to...@jakarta.apache.org>
> Sent: Thursday, December 12, 2002 3:53 PM
> Subject: RE: need help urgently
> 
> 
> >
> > the workaround that would be to put a link (include) in test1 and test2
> > that links to the ../include
> >
> > Alex.
> >
> > > -----Original Message-----
> > > From: Eman Fattouh [mailto:eman.fattouh@menanet.net]
> > > Sent: Thursday, December 12, 2002 8:48 AM
> > > To: Tomcat Users List
> > > Subject: need help urgently
> > >
> > >
> > > dear all;
> > >      i have some applications under webapps folder. all of them
> > > must include some static html files. the problem is if i jave the
> > > following file system:
> > >  /var/tomcat4/webapps/test1 ------> application 1 containing
> > > test1.jsp file and others
> > >  /var/tomcat4/webapps/test2 -------> application 2
> > >  /var/tomcat4/webapps/includes ----> folder containing only html
> > > static files, not an application , for example: topfile.htm
> > >
> > > how to refer to these static files (inside includes) from my jsp?
> > > for example, when i refer to topfile.htm from test1.jsp as follows:
> > > <jsp:include page="../includes/topfile.htm" flush="true"/>
> > > the page is loaded balnk. why?
> > >
> > > is it not allowed to refer to any folder outside my application?
> > > if so, how to work around that?
> > > Regards
> > > Iman
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> >
> 
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


-- 
Kris Schneider <ma...@dotech.com>
D.O.Tech       <http://www.dotech.com/>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: need help urgently

Posted by Eman Fattouh <em...@menanet.net>.
i'm appreciating your response, but are u sure that there is no another
solution? i can't use links as these files are the banner and footer of the
site, so i have to use jsp:include tag..
all that i want to make sure..is it really not permitted to refer to any
static resources outside my webapplication?
if it is possible.. how to?

----- Original Message -----
From: "Aleksandr Shneyderman" <al...@law.columbia.edu>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Thursday, December 12, 2002 3:53 PM
Subject: RE: need help urgently


>
> the workaround that would be to put a link (include) in test1 and test2
> that links to the ../include
>
> Alex.
>
> > -----Original Message-----
> > From: Eman Fattouh [mailto:eman.fattouh@menanet.net]
> > Sent: Thursday, December 12, 2002 8:48 AM
> > To: Tomcat Users List
> > Subject: need help urgently
> >
> >
> > dear all;
> >      i have some applications under webapps folder. all of them
> > must include some static html files. the problem is if i jave the
> > following file system:
> >  /var/tomcat4/webapps/test1 ------> application 1 containing
> > test1.jsp file and others
> >  /var/tomcat4/webapps/test2 -------> application 2
> >  /var/tomcat4/webapps/includes ----> folder containing only html
> > static files, not an application , for example: topfile.htm
> >
> > how to refer to these static files (inside includes) from my jsp?
> > for example, when i refer to topfile.htm from test1.jsp as follows:
> > <jsp:include page="../includes/topfile.htm" flush="true"/>
> > the page is loaded balnk. why?
> >
> > is it not allowed to refer to any folder outside my application?
> > if so, how to work around that?
> > Regards
> > Iman
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: need help urgently

Posted by Aleksandr Shneyderman <al...@law.columbia.edu>.
the workaround that would be to put a link (include) in test1 and test2
that links to the ../include

Alex.

> -----Original Message-----
> From: Eman Fattouh [mailto:eman.fattouh@menanet.net]
> Sent: Thursday, December 12, 2002 8:48 AM
> To: Tomcat Users List
> Subject: need help urgently
> 
> 
> dear all;
>      i have some applications under webapps folder. all of them 
> must include some static html files. the problem is if i jave the 
> following file system:
>  /var/tomcat4/webapps/test1 ------> application 1 containing 
> test1.jsp file and others
>  /var/tomcat4/webapps/test2 -------> application 2
>  /var/tomcat4/webapps/includes ----> folder containing only html 
> static files, not an application , for example: topfile.htm
> 
> how to refer to these static files (inside includes) from my jsp?
> for example, when i refer to topfile.htm from test1.jsp as follows:
> <jsp:include page="../includes/topfile.htm" flush="true"/>
> the page is loaded balnk. why?
> 
> is it not allowed to refer to any folder outside my application? 
> if so, how to work around that?
> Regards
> Iman

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>