many url-pattern for the same servlet

后端 未结 2 1044
眼角桃花
眼角桃花 2020-12-09 01:15

I need to map the same servlet on two different url. I used netbeans 7.0.1 for managing my whole project, so I used its friendly interface to modify the web.xml file. What n

2条回答
  •  南笙
    南笙 (楼主)
    2020-12-09 02:18

    I guess it has more to do with the servlet spec the container/netbeans is using rather than being an issue with the container. Your net beans seems to be using the spec 2.5 to construct the servlet mapping and hence you get

    
       fred
       *.jsp
       /url
    
    

    Read more about this here. It says

    Previous versions of the servlet schema allows only a single url-pattern in a filter mapping.For filters mapped to multiple URLs this results in needless repetition of whole mapping clauses.

提交回复
热议问题