web.xml配置servlet时路径匹配
自定义的servlet必须继承HttpServlet或者实现Servlet
还需要在web.xml中配置色servlet,才能正常运行。在配置url-pattern 有两种方式
1精确匹配 /xxx/xxx 访问时输入http://localhost:8080/ProjectName/xxx/xxx
2.模糊匹配
2.1 /* 可以匹配任何请求 包括http://localhost:8080
2.2 *.suffix 可以是任何后缀
注:当一个请求被多个url-pattern 匹配时,它会匹配最接近的一个。 二:带后缀的url-pattern匹配的优先级最低