Results 1 to 2 of 2

Thread: Tomcat Servlet Mapping

  1. #1
    Join Date
    Oct 2004
    Location
    Germany
    Posts
    143

    Default Tomcat Servlet Mapping

    Hi,

    i have simple servlet mapping Problem with Tomcat, its not specialy for spring but i hope someone can help me.

    if i call url: /admin/images/test.png than servelt 1 should handel this request
    if i call /someotherurl/xy.png than servelt 2 should handel the request.

    so i wrote the following servlet mapping:

    Code:
         <servlet-mapping>
            <servlet-name>Servlet1</servlet-name>
            <url-pattern>/admin/images/*</url-pattern>
         </servlet-mapping>
         <servlet-mapping>
            <servlet-name>Servlet2</servlet-name>
            <url-pattern>*.png</url-pattern>
         </servlet-mapping>
    but when i now call: /admin/images/test.png i get a 404 error, even the directorys and files are correct und available.

    os it seems that the servlet spec for servlet mapping is not working right in Tomcat.

    can anyone confirm this?

    or where is my mistake?
    hope someone can help me.

    thank you very much.

    mfg Gideon

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,695

    Default

    What does your servlet do? Does it do anything?

    Why not simply create the /admin/images/test.png directory in your war, instead of letting a servlet handle those requests?

    Also show use your complete web.xml.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •