On Mon, 23 Apr 2001, Lian, Xiaobu (Alice) (Xiaobu (Alice)) wrote:
> Hi Milt,
>
> You are right. This is exactly what I had experienced. Please see
> my previous posted message yesterday (4/22/01) "mod_jk.conf
> configuration: Access servlets from apache server with url
> <servername>/servlets/<servlet-class>".
>
> I use mod_jk and play with mod_jk.conf-local for a while, but did
> not fiugure out how to make apache knowing servlets to send to
> tomcat. Do you have any ideas about how to configure mod_jk.conf?
> Thanks a lot!
I went back and looked at your previous post. Are you saying you want
to be able to specify the URL without the context name? That is,
normally you use URLs of the form:
http:<servername>/<contextname>/servlets/<servletclass>
but you want to use:
http:<servername>/servlets/<servletclass>
Is that correct?
Can't you do this by putting the servlets in the root context?
> -----Original Message-----
> From: Milt Epstein [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 23, 2001 9:49 AM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: Problem mapping servlets to /servlets/*
>
>
> On Mon, 23 Apr 2001, Diego Castillo wrote:
>
> > Hi,
> >
> > I am quite new to Tomcat and I have encountered problems in mapping
> > servlets to specific URLs. Basically, I want my servlets to be
> > activated when invoked through an URL that contains /servlets/* in
> > addition to default /servlet/*.
> >
> > I have added the following to my %TOMCAT_HOME%\conf\web.xml:
> >
> > <web-app>
> > [...]
> > <servlet-mapping>
> > <servlet-name>
> > invoker
> > </servlet-name>
> > <url-pattern>
> > /servlets/*
> > </url-pattern>
> > </servlet-mapping>
> > [...]
> > </web-app>
> >
> > This does not work. If I point to
> > http://localhost/servlets/IsItWorking instead of
> > http://localhost/servlet/IsItWorking, Apache is not able to find the
> > appropriate page.
>
> I suspect the key point there is that *Apache* is not able to find the
> appropriate page, i.e. it's not even getting to Tomcat. The web.xml
> files are only read by Tomcat. My guess is you need to insert some
> appropriate directives in the tomcat/apache conf file so that Apache
> knows to pass these URLs to Tomcat in the first place. What exactly
> those are depends on which module you're using to connect Tomcat to
> Apache (mod_jserv, mod_jk, mod_webapp). Check the tomcat/apache conf
> file you have now for samples.
Milt Epstein
Research Programmer
Software/Systems Development Group
Computing and Communications Services Office (CCSO)
University of Illinois at Urbana-Champaign (UIUC)
[EMAIL PROTECTED]