Servlet question(Tomcat, web.xml, servlet-class, servlet-name)

Discussion in 'Java' started by circuit_breaker, Apr 3, 2004.

  1. Hi everyone,

    I just upgraded from a 4.1.10 Tomcat implementation on NT4 to a Tomcat
    5.0.19 on Linux. Works fine but...

    On the NT4 box, my web.xml look like this:
    ---
    <servlet>
    <servlet-name>Testing</servlet-name>
    <servlet-class>TestingServlet</servlet-class>
    </servlet>
    ---

    and I can call the servlet this way:
    http//ntgate:8090/myApp/servlet/Testing

    On the Linux box, I have something like this:
    ---
    <servlet>
    <servlet-name>TestingServlet</servlet-name>
    <servlet-class>TestingServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>TestingServlet</servlet-name>
    <url-pattern>/servlet/TestingServlet</url-pattern>
    </servlet-mapping>

    When I call the servlet, I have to type "TestingServlet" in the URL in
    order to have it working. If I change "TestingServlet" for "Testing"
    in my web.xml file, the servlet doesn't show up.

    What's the trick?

    Thanks you.
     
    circuit_breaker, Apr 3, 2004
    #1
    1. Advertising

  2. circuit_breaker

    Stefano Guest

    "circuit_breaker" <> ha scritto nel messaggio
    news:...
    > Hi everyone,
    >
    > I just upgraded from a 4.1.10 Tomcat implementation on NT4 to a Tomcat
    > 5.0.19 on Linux. Works fine but...
    >
    > On the NT4 box, my web.xml look like this:
    > ---
    > <servlet>
    > <servlet-name>Testing</servlet-name>
    > <servlet-class>TestingServlet</servlet-class>
    > </servlet>
    > ---
    >
    > and I can call the servlet this way:
    > http//ntgate:8090/myApp/servlet/Testing
    >
    > On the Linux box, I have something like this:
    > ---
    > <servlet>
    > <servlet-name>TestingServlet</servlet-name>
    > <servlet-class>TestingServlet</servlet-class>
    > </servlet>
    > <servlet-mapping>
    > <servlet-name>TestingServlet</servlet-name>
    > <url-pattern>/servlet/TestingServlet</url-pattern>
    > </servlet-mapping>
    >
    > When I call the servlet, I have to type "TestingServlet" in the URL in
    > order to have it working. If I change "TestingServlet" for "Testing"
    > in my web.xml file, the servlet doesn't show up.
    >
    > What's the trick?
    >
    > Thanks you.


    Did you restart tomcat to apply modifications?
     
    Stefano, Apr 3, 2004
    #2
    1. Advertising

  3. circuit_breaker

    Jack Jia Guest

    You should change url-pattern. Whatever you type in your browser is a url,
    right?

    Jack

    "circuit_breaker" <> wrote in message
    news:...
    > Hi everyone,
    >
    > I just upgraded from a 4.1.10 Tomcat implementation on NT4 to a Tomcat
    > 5.0.19 on Linux. Works fine but...
    >
    > On the NT4 box, my web.xml look like this:
    > ---
    > <servlet>
    > <servlet-name>Testing</servlet-name>
    > <servlet-class>TestingServlet</servlet-class>
    > </servlet>
    > ---
    >
    > and I can call the servlet this way:
    > http//ntgate:8090/myApp/servlet/Testing
    >
    > On the Linux box, I have something like this:
    > ---
    > <servlet>
    > <servlet-name>TestingServlet</servlet-name>
    > <servlet-class>TestingServlet</servlet-class>
    > </servlet>
    > <servlet-mapping>
    > <servlet-name>TestingServlet</servlet-name>
    > <url-pattern>/servlet/TestingServlet</url-pattern>
    > </servlet-mapping>
    >
    > When I call the servlet, I have to type "TestingServlet" in the URL in
    > order to have it working. If I change "TestingServlet" for "Testing"
    > in my web.xml file, the servlet doesn't show up.
    >
    > What's the trick?
    >
    > Thanks you.
     
    Jack Jia, Apr 4, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sean Clarke
    Replies:
    1
    Views:
    1,950
    Sudsy
    Jan 7, 2004
  2. Doug McCann
    Replies:
    1
    Views:
    1,151
    William Brogden
    Aug 5, 2004
  3. Replies:
    0
    Views:
    892
  4. Replies:
    5
    Views:
    543
  5. Replies:
    1
    Views:
    434
Loading...

Share This Page