You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jim Michael <jm...@chesterfield.mo.us> on 2001/10/06 02:41:27 UTC

context problems

I have Tomcat plugged into Apache, and all works well. However, I want to be able to place .jsp files *in* the Apache document directory structure and have them handles by Tomcat. I tried to create a Tomcat context like so:

<Host name = "www.myserver.com">
<Context path=""
    docBase="/var/www/html"
    crossContext="false"
    debug="0"
    reloadable="true">
</Context>
</Host>

This does indeed let me put JSP pages in the Apache directories and execute them. However, it also kills the abilty to run servlets sitting in the ROOT context via a /servlet URL.

How can I get the contexts defined so that /servlet still maps to ROOT, but JSPs can be run from the Apache docs directories?

Jim


URL bug for jasper or "per spec"?

Posted by David Wall <dw...@Yozons.com>.
I'm running Tomcat 3.2.3 using Apache with mod_jk.  The mod_jk mount
configuration for Apache is:

    JkMount /ssd/servlet/* ajp13
    JkMount /ssd/*.jsp ajp13

I have an URL that is designed such that it's supposed to run my servlet,
but still contain a file name since it's for a file download servlet.  Some
browsers use the name from the URL to select the "save as" name when you do
a download (yes, we also set the Content-disposition for those browsers that
will deal with it).  The URL will look like:

/ssd/servlet/GA/file.txt -- which would download a file called 'file.txt'
from our servlet mapped at /ssd/servlet/GA.  Normally, the 'file.txt' is
returned as the query string for my servlet.

But, if I have a file that ends in .JSP:

/ssd/servlet/GA/file.jsp

Tomcat doesn't run the GA servlet with 'file.jsp' as the query string.
Instead. Tomcat thinks this must be a JSP and of course doesn't like it and
produces an error.  The Jasper log shows the confusion:

2001-10-05 18:27:44 -        ServletPath: /servlet/GA/file.jsp
2001-10-05 18:27:44 -           PathInfo: null
2001-10-05 18:27:44 -           RealPath:
/home/tomcat/jakarta-tomcat-3.2.3/WebSsd2/remoteapps/ssd/servlet/GA/file.jsp
2001-10-05 18:27:44 -         RequestURI: /ssd/servlet/GA/file.jsp

Is this a bug in jasper, in that it doesn't recognize that it should find
the GA servlet, or is this the way it's supposed to work according to spec
since the URL ends with .jsp?

David