This article mainly introduces the relevant information about the use of url-pattern in JavaWeb Servlet. I hope this article can help everyone learn and understand this part of the content. Friends in need can refer to it
Usage of url-pattern in JavaWeb Servlet
1. Instructions related to url-pattern of Sevlet and Filter
A page request is based on url -pattern only matches the best Servlet, and according to the order of the filter-mapping tags in web.xml, one or more filters that meet the requirements will be generated into a FilterChain
2.url- pattern configuration
Configure the web.xml file to define the meaning of mapping:
(1).Start with "/"-->Path mapping
(2). "*. Do" front-& gt; extended mapping
(3). "/"-& gt; default service mapping.
(4). Detailed definition
& lt; url-pattern & gt;/*. Do & lt;/url-pattern & gt; / / "The beginning will match the path mapping and the extension mapping, causing the container to be unable to determine.
3.url-pattern matching rules
(2). Longest path matching
servletB
The above is the detailed content of Detailed explanation of the use of url-pattern in JavaWeb Servlet. For more information, please follow other related articles on the PHP Chinese website!