<welcome-file-list&>
<welcome-file&>index.html</welcome-file&>
<welcome-file&>index.jsp</welcome-file&>
</welcome-file-list&>
function : specify the home page of the web project (i.e. visit ) http://localhost : 8080/
displayed page)
working principle : Taking the code above as an example, two home pages are set. Then, the system will check whether the file exists in the web directory in order. (that is, first check whether there is a index.html If there is, the file will be displayed; otherwise, check whether it exists index.jsp 。)
supplement :
If the URL pattern of the servlet is /*
, then http://localhost : 8080/
does not match welcome file list, but matches the servlet
If the URL pattern is /
, the servlet will match welcome file list when it fails to find a suitable match.
Reference
[1] About web.xml CSDN blog
Similar Posts:
- How to Solve Error: The content of element type “web-app” must match “(icon?display
- Error 404 when accessing pictures in the project directory
- How to Solve Error: Cannot read property ‘map’ of undefined
- [LeetCode] 291. Word Pattern II
- [Solved] Spring Error: Artifact spring:war exploded: Error during artifact deployment. See server log for details
- Analysis of some records in the process of cracking rar password with hashcat and the error reported by separator unmatched
- ImportError: cannot import name ‘patterns’
- Git LS files displays the current file status
- import javax.servlet.http.HttpSession;
- How to Solve Python TypeError: ‘list’ object is not callable