You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Konrad Steinmuller <ko...@steinmuller.com> on 2004/02/27 15:01:03 UTC

<%@ include file=> outside of current context

I am trying to refer to a different context from within another context
via an <%@include file="/media/javascripts/common.jsp" %> directive.

What i get is a : JasperException :  /newdnr/standard/header.jsp(57,0)
File "/media/javascripts/common.jsp" not found

my contexts are : 

<Context path="" docBase="/www/dnr" debug="0" reloadable="true"
crossContext="true"/>
<Context path="/media/" docBase="/www/DNR_Media" debug="0"
reloadable="true" crossContext="true"/>

The file "/newdnr/standard/header.jsp" is in the root context, but the
include "/media/javascripts/common.jsp" is in the media context.

Nothing I do seems to make one see the other. There is not a problem
when calling them from my web browser (I am using the JK2 connector)
using html, just referring to them internally in the jsp. 

Is this what the ServletContext.getContext(java.lang.String UriPath)
function helps you achieve? If so has anybody used it?

I know I could rearrange my file and context system to make it work, but
I am porting an application from JRun, and am trying to emulate JRun's
behaviour as best I can.

I have looked in the Tomcat docs, and gone through archives and found a
few people with the same problem, but no solutions. Thought I'd throw it
out there before I attempt to modify the tomcat source code.

Regards 
Konrad Steinmuller


Re: <%@ include file=> outside of current context

Posted by Tim Funk <fu...@joedog.org>.
You can't compile time include a file outside your context.

-Tim

Konrad Steinmuller wrote:
> I am trying to refer to a different context from within another context
> via an <%@include file="/media/javascripts/common.jsp" %> directive.
> 
> What i get is a : JasperException :  /newdnr/standard/header.jsp(57,0)
> File "/media/javascripts/common.jsp" not found
> 
> my contexts are : 
> 
> <Context path="" docBase="/www/dnr" debug="0" reloadable="true"
> crossContext="true"/>
> <Context path="/media/" docBase="/www/DNR_Media" debug="0"
> reloadable="true" crossContext="true"/>
> 
> The file "/newdnr/standard/header.jsp" is in the root context, but the
> include "/media/javascripts/common.jsp" is in the media context.
> 
> Nothing I do seems to make one see the other. There is not a problem
> when calling them from my web browser (I am using the JK2 connector)
> using html, just referring to them internally in the jsp. 
> 
> Is this what the ServletContext.getContext(java.lang.String UriPath)
> function helps you achieve? If so has anybody used it?
> 
> I know I could rearrange my file and context system to make it work, but
> I am porting an application from JRun, and am trying to emulate JRun's
> behaviour as best I can.
> 
> I have looked in the Tomcat docs, and gone through archives and found a
> few people with the same problem, but no solutions. Thought I'd throw it
> out there before I attempt to modify the tomcat source code.


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org