tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Goss <mg...@rtci.com>
Subject Re: tomcat won't find my servlets ;-(((
Date Thu, 31 Aug 2000 14:20:38 GMT
Mike,
I'm not too sure about more precise path information in the tomcat.conf file.
I know it can be done, and that how it is done depends on how specific a
mapping you are interested in doing. Anyone else care to venture an opinion
on this one???
As for the servlet mapping... This is for mapping a servlet of one name to a
specific URI. For instance, if you have a servlet  called myservlet in the
package com.blah.foo.servlets and you wanted every request that had /info in
it to be routed through that servlet then your web.xml should look  like:
<servlet>
        <servlet-name>myservlet</servlet-name>
        <servlet-class>com.blah.foo.servlets.myservlet</servlet-class>
</servlet>
<servlet-mapping>
        <servlet-name>myservlet</servlet-name>
        <url-pattern>/info</url-pattern>
</servlet-mapping>
then you can use the URL
http://mydomain/mycontextname/info/somemorepath?somedata  to access the
servlet.
hope this helps,
Matt

mike niemaz wrote:

> Matt Goss wrote:
>
> > Mike,
> > the apjservmount is used to tell apache to go to tomcat for anything
> > inside a specific context (ie http://mydomain/mycontextname/ gets sent
> > to tomcat)
>
> OK, can I specify more precise paths? If so, what would the syntax
> in the tomcat.conf file?
>
> > The web.xml is used for servlet mappings and such.... for instance:
> > If you have a servlet  (myservlet) in a packege (com.blah.foo.servlets)
> > you need a mapping in the web.xml that looks like this:
> > <servlet>
> >         <servlet-name>myservlet</servlet-name>
> >         <servlet-class>com.blah.foo.servlets.myservlet</servlet-class>
> > </servlet>
> > then you can access the servlet vi the url:
> > http://www.mydomain.com/mycontextname/servlet/myservlet
>
> At the moment my servlet is loaded & works no matter what I write
> in the web.xml file ... kind of annoying though I understand what you
> say.
> You mentionned
> <servlet>
>         <servlet-name>xxx</servlet-name>
>         <servlet-class>xxx</servlet-class>
>     </servlet>
> What is this one for:
>     <servlet-mapping>
>         <servlet-name>xxx</servlet-name>
>         <url-pattern>/xxx</url-pattern>
>     </servlet-mapping>
>
> Thanx anyway.
> --mike

Mime
View raw message