Yes, it works under the default directory with the examples in the "test"
context -- but, no, it won't work with mod_jk.conf-auto, because the auto
generated config has this as it's defaults for JkMount:
JkMount /test/servlet/* ajp12
JkMount /test/*.jsp ajp12
This MUST be changed to:
JkMount /test/servlet/* ajp12
JkMount /test/* ajp12
in order for servlet-mapping to work. The re-mapped servlets are then called
from /test/ not from /test/servlet/. Obviously, you can use either
connector. I'm using ajp13 in my non-auto-generated mod_jk.conf.
Thanks,
--jeff
----- Original Message -----
From: "Todd Pfaff" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: "Jeff Kilbride" <[EMAIL PROTECTED]>
Sent: Friday, March 30, 2001 2:29 PM
Subject: Re: 2nd Post: Servlets and mod_jk problem
> ok, it sounds like we're getting somewhere...
>
> Jeff, could you now try the examples servlets that come with tomcat-3.2.1
> and translate your solution to those and the default mod_jk.conf-auto?
>
> Todd
>
> On Fri, 30 Mar 2001, Jeff Kilbride wrote:
>
> > AHA!!!
> >
> > Actually, using my old config, pulling up
> > mydomain.com/test/foo/bar/myServlet returned an Apache 404 error. I had
> > tried that initially and gave up when Apache returned the error. But
your
> > post turned the little lightbulb on in my head! :o)
> >
> > It makes sense that /test/foo/bar/myServlet wasn't pulling up, because
in my
> > original config I hadn't specified a connector for /test/* -- only for
> > /test/*.jsp and /test/servlet/*, like the examples in mod_jk.conf-auto.
So,
> > I went back and changed my original config to this:
> >
> > JkMount /test/*
> > JkMount /test/servlet/*
> >
> > And POOF!! Now everything works. The only thing that sucks is that you
have
> > to serve the whole directory via Tomcat in order to use
servlet-mappings --
> > HTML and all. Maybe there should be a way to *turn off* extensions as
well
> > as turn them *on*, so you could specify to Tomcat not to serve *.html.
> > (!*.html ??) I wonder if it's documented anywhere that in order to use
> > servlet-mappings, you need to do this as opposed to following the
examples
> > and mod_jk.conf-auto. (should be...)
> >
> > My /test servlet didn't interfere, because it's actually set up in a
> > different context under a virtual host -- using the <Host> directive in
> > server.xml.
> >
> > One down!!
> >
> > Thanks, Milt. This was bugging me.
> >
> > --jeff
> >
> >
> > ----- Original Message -----
> > From: "Milt Epstein" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Friday, March 30, 2001 1:42 PM
> > Subject: Re: 2nd Post: Servlets and mod_jk problem
> >
> >
> > > On Fri, 30 Mar 2001, Jeff Kilbride wrote:
> > >
> > > [ ... ]
> > > > Here's the servlet-mapping from web.xml file that comes with the
> > > > distribution:
> > > > <servlet>
> > > > <servlet-name>
> > > > servlet1
> > > > </servlet-name>
> > > > <servlet-class>
> > > > requestMap.Servlet1
> > > > </servlet-class>
> > > > </servlet>
> > > >
> > > > <servlet-mapping>
> > > > <servlet-name>
> > > > servlet1
> > > > </servlet-name>
> > > > <url-pattern>
> > > > /foo/bar/*
> > > > </url-pattern>
> > > > </servlet-mapping>
> > > >
> > > > Here's a snippet from my tomcat.log when I try to pull up
> > > > mydomain.com/test/servlet/foo/bar/myServlet:
> > > > 985983892264 - Ctx( /test ): 404 R( /test + /servlet/foo +
> > /bar/myServlet)
> > > > null
> > >
> > > Did you try the URL:
> > >
> > > mydomain.com/test/foo/bar/myServlet
> > >
> > > i.e. without the "/servlet"? My impression is that the url-pattern's
> > > in servlet-mapping's are meant to follow the context part of the URL,
> > > and that you don't need to include "/servlet" (although you do need to
> > > include it if you are just using the servlet-name or the fully
> > > qualified servlet-class). That is, part of the point of using
> > > servlet-mapping's is so you don't need to have the "/servlet" in the
> > > URL. This might explain some of your apparent anomalies when using
> > > "test" (you had it both as the servlet-name and the url-pattern in a
> > > servlet-mapping, IIRC).
> > >
> > >
> > > > This mapping is supposed to map everything under /servlet/foo/bar/
to
> > > > servlet1 -- but as you can see, Tomcat is saying /servlet/foo, with
> > extra
> > > > path info /bar/myServlet, doesn't exist. When I pull up
> > > > mydomain.com/test/servlet/requestMap.Servlet1 or
> > > > mydomain.com/test/servlet/servlet1, everything works as it should.
So,
> > > > Tomcat is not paying attention to the servlet-mapping entry.
> > > >
> > > > I think this is a problem, unless somebody has an explanation. I'm
out
> > of
> > > > ideas.
> > > [ ... ]
> > >
> > > Milt Epstein
> > > Research Programmer
> > > Software/Systems Development Group
> > > Computing and Communications Services Office (CCSO)
> > > University of Illinois at Urbana-Champaign (UIUC)
> > > [EMAIL PROTECTED]
> > >
> >
> >
>
> --
> Todd Pfaff \ Email: [EMAIL PROTECTED]
> Computing and Information Services \ Voice: (905) 525-9140 x22920
> ABB 132 \ FAX: (905) 528-3773
> McMaster University \
> Hamilton, Ontario, Canada L8S 4M1 \
>
>