How are Servlet url mappings in web.xml used?

前端 未结 2 1332
囚心锁ツ
囚心锁ツ 2020-11-27 16:17

I have a web.xml file with content:


    servlet1
    

        
2条回答
  •  一个人的身影
    2020-11-27 16:48

    Your paths conflict.

    Both of your paths mean the same, the '/*' doesn't make any difference. Apparently then when you try your path, the last match (servlet2) is executed.

    You usually put in a path with the Servlet name, like for example:

    /path/test/servlet1
    /path/test/servlet2
    

提交回复
热议问题