You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Takeshi L Toyohara <ta...@toyohara.net> on 2002/02/22 22:53:57 UTC

servlet-mapping problem

howdy,

i am trying to just play around with tomcat and try to get some servlets
running.  I am having a problem getting the servlet-mapping to work in my
web.xml and am wondering if i can get you guys to help out.


here's my web.xml.  the servlet-mapping tag works only the way it is now (im
guessing b/c its actually only using the invoker servlet).  i cant change it
to anything else, such as /wars or /blah, etc. and get it to work.  any
ideas?

any info is much appreciated!

cheers
t


<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>
    <display-name>WAR TEST</display-name>
    <description>Testing WAR'ing files</description>

    <servlet>
        <servlet-name>warservlet</servlet-name>
        <description>the hello dude servlet</description>
        <servlet-class>wartest.HelloDudeServlet</servlet-class>
        <init-param>
             <param-name>helloparam</param-name>
             <param-value>Hello Dude</param-value>
        </init-param>
    </servlet>

  <servlet-mapping>
    <servlet-name>warservlet</servlet-name>
    <url-pattern>/servlet/warservlet</url-pattern>
  </servlet-mapping>

</web-app>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: servlet-mapping problem

Posted by Dave Ferguson <df...@touchnet.com>.
This is basic stuff.  It should work.  What URL are you using to invoke the servlet?  With no mapping the URL would be http://server/servlet/warservlet.  If your mapping is

  <url-pattern>/blah</url-pattern>

then the URL would be http://server/blah.  Restart Tomcat to be sure your changes take effect.

- df

Takeshi L Toyohara wrote:

> howdy,
>
> i am trying to just play around with tomcat and try to get some servlets
> running.  I am having a problem getting the servlet-mapping to work in my
> web.xml and am wondering if i can get you guys to help out.
>
> here's my web.xml.  the servlet-mapping tag works only the way it is now (im
> guessing b/c its actually only using the invoker servlet).  i cant change it
> to anything else, such as /wars or /blah, etc. and get it to work.  any
> ideas?
>
> any info is much appreciated!
>
> cheers
> t
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
>
> <!DOCTYPE web-app
> PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
> "http://java.sun.com/dtd/web-app_2_3.dtd">
>
> <web-app>
>     <display-name>WAR TEST</display-name>
>     <description>Testing WAR'ing files</description>
>
>     <servlet>
>         <servlet-name>warservlet</servlet-name>
>         <description>the hello dude servlet</description>
>         <servlet-class>wartest.HelloDudeServlet</servlet-class>
>         <init-param>
>              <param-name>helloparam</param-name>
>              <param-value>Hello Dude</param-value>
>         </init-param>
>     </servlet>
>
>   <servlet-mapping>
>     <servlet-name>warservlet</servlet-name>
>     <url-pattern>/servlet/warservlet</url-pattern>
>   </servlet-mapping>
>
> </web-app>
>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>