tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Jones" <kev...@develop.com>
Subject RE: Non-context paths
Date Wed, 24 May 2000 21:44:17 GMT
I'm assuming that it's being treated as a context, I don't know for sure.

I've moved the ROOT context to point at my own web app. Within that
directory I've created a docs directory and put a file called index.jsp in
there. If I browse to that directory (http://localhost/docs/index.jsp) then
I see nothing. If I create a docs (or any other directory) off-of another
'context' I can browse to that OK.

Actually on retesting it can't think it's a context - if I browse to
http://localhost/fred I get a 404. Also, if I put back the original ROOT and
remove my context from server.xml then I can get to /docs/api.

OK - I've narrowed the problem down - if I put a static page in the sub
directory it works fine, however if I put a JSP in there, it gets parsed
into a .java file of size 0, doesn't get compiled and so doesn't produce any
output!

This is true for all applications (contexts) - the file gets parsed to this

_0002fdocs_0002findex_0002ejspindex_jsp_0.java

where docs is the sub-directory and index.jsp is the name of the file, so
JSPs in anything other that the context root directory don't get compiled
properly.

A bug methinks?


Kevin Jones
DevelopMentor
www.develop.com

> -----Original Message-----
> From: Craig R. McClanahan [mailto:Craig.McClanahan@eng.sun.com]
> Sent: 24 May 2000 17:12
> To: tomcat-user@jakarta.apache.org
> Subject: Re: Non-context paths
>
>
>
>
> Kevin Jones wrote:
>
> > In Tomcat I can create a new 'application' by adding a context
> entry to the
> > server.xml file and creating a sub-directory that contains my resources.
> > Within that application I can have further sub-directories that
> contain .jsp
> > files or html files. So if I have an application called foo, I have
> > c:\tomcat\webapps\foo and I can browse to
> http://localhost/foo/default.htm.
> > Within foo I can create a sub-directory called bar (so I have
> > c:\tomcat\webapps\foo\bar) and I can browse to
> > http://localhost/foo/bar/quux.htm This is good.
> >
> > My question is - how do I do this for the root context?
> >
> > My root context is in c:\tomcat\webapps\ROOT and I browse to it by going
> > http://localhost/defalt.htm I'd like to be able to organise my root into
> > several sub-directories so have c:\tomcat\webapps\ROOT\xml and
> > c:\tomcat\webapps\ROOT\java and be able to browse to
> > http://localhost/java/javahome.jsp but Tomcat treats /java as a
> context not
> > as a sub directory!
> >
> > Is there anyway to tell Tomcat that a 'path' isn't a context?
> >
>
> How are you determining that Tomcat is treating this as a
> context?  It only
> would if you defined a webapp attached to context path "/xml" or "/java".
>
> In the default configuration that ships with Tomcat, the ROOT
> context has a
> subdirectory named "docs" that contains (among other things) the API
> documentation.  In this case Tomcat knows that "/docs" is a
> subdirectory because
> there is no matching context path, so it works the way you are describing.
>
> >
> > Kevin Jones
> > DevelopMentor
> > www.develop.com
> >
>
> Craig McClanahan
>
>
>
> --------------------------------------------------------------------------
> To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commmands, email: tomcat-user-help@jakarta.apache.org


Mime
View raw message