Hmm..seems like it should work fine. I do this sort of stuff
right now, and there are no problems.
One note: I set path to an *empty string*, not to "/"..don't
know if this makes a difference or not.
server.xml:
<Context path=""
docBase="/home/ola3dev/webserver/docroot"
debug="0"
reloadable="false" >
</Context>
directory "/home/ola3dev/webserver/docroot" is layed out like:
WEB-INF
directory1
file1.jsp
file2.jsp
directory2
file3.jsp
file4.jsp
and files in one directory can include files in another
directory without problem.
One question: what happens if you put plain html
files directly into the docBase directory. Can you
access them from tomcat??
> -----Original Message-----
> From: Bruce Cota [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, December 18, 2000 2:46 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Includes
>
> Thanks for the reply
>
> The problem I have is that I cannot get a context with the
> path "/" to work -- I just get 404's. The site I'm trying
> to work on (which already exists) uses url's like
> "www.company.com/app1/index.jsp" and
> "www.company.com/app2/index.jsp", where both
> index1.jsp and index.2.jsp include urls like
> "/include/setup.jsp". I can't seem to make this
> work in tomcat 3.2. In tomcat 3.1 I did it by
> setting up a Context with path="/" and
> a docBase set to the parent directory which
> includes "app1", "app2", and "include".
> But in 3.2 when I do this I get 404's.
>
> Kitching Simon wrote:
>
> > Hi Bruce,
> >
> > I'm not entirely sure what your problem is.
> >
> > I'm almost certain you cannot include files "across contexts"
> > using <jsp:include> (ie run-time include). That would involve
> > invoking a servlet in one context from a servlet in another
> > context.
> >
> > I'm almost certain that <%@ include url> (ie compile-time include)
> > would not work across contexts either. The JSP specification
> > (I used jsp1.2b1) states that the url *must* be a relative URL. It
> > also states that the included page is "subject to access control",
> > ie only files accessable from the webapp are includable; this seems
> > to rule out including any file that is not under the webapp-specific
> > document root, ie nothing stored in another webapp(context) can
> > be included.
> >
> > Why can't you have all your files in a single context?? And
> > what is the relevance of the context path? Including of files
> > should work regardless of what prefix the webapp(context) has
> > been given.
> >
> > Regards,
> >
> > Simon
> >
> > > -----Original Message-----
> > > From: Bruce Cota [SMTP:[EMAIL PROTECTED]]
> > > Sent: Monday, December 18, 2000 9:23 AM
> > > To: [EMAIL PROTECTED]
> > > Subject: Includes
> > >
> > > Hi, I'm a newcomer to Tomcat and recently upgraded from
> > > 3.1 to 3.2. I have been working on a site in which one
> > > directory holds files included in several sibling directories.
> > >
> > > With 3.1, I was able to use a Context with path="/", but
> > > with 3.2 this does not seem to work -- I get 404's from
> > > tomcat in 3.2.
> > >
> > > I tried breaking up my directories into different contexts, but
> > > I can't seem to get includes to work across contexts -- I get
> > > "Bad file argument to include" when I try to include a jsp
> > > from the "include context" in a file in one of the other
> > > contexts. For that matter, I seem to have the same problem
> > > when I use anything but a relative url in an include.
> > >
> > > Am I doing something wrong? Is there a way to use
> > > a path="/" in a 3.2 context, or can I include files across
> > > contexts?
> > >
> > > Thanks for any advice,
> > > -Bruce