1 < web-app > 2 3 <!-- Define the name of the WEB application --> 4 < display-name ></ display-name > 5 6 <!-- Declare the description information of the WEB application --> 7 < description ></ description > 8 9 <!-- The context-param element declares application-wide initialization parameters --> 10 < context-param ></ context-param > 11 12 <!-- The filter element will have a name Associated with a class that implements the javax.servlet.Filter interface --> 13 < filter ></filter > 14 15 <!-- Once a filter is named, associate it with one or more servlets or JSP pages using the filter-mapping element --> 16 < filter-mapping ></ filter-mapping > 17 18 <!-- Version 2.3 of the servlet API added support for event listeners, which are notified when a session or servlet context is created, modified, and deleted. 19 The Listener element indicates the event listener class --> 20 < listener ></ listener > 21 22 <!-- When making initialization parameters or custom URLs to a servlet or JSP page, you must first name the servlet or JSP page. 23 Servlet element is used to accomplish this task --> 24 < servlet >< 25 26 <!-- The server generally provides a default URL for the servlet: http://host/webAppPrefix/servlet/ServletName. 27 However, this URL is often changed so that the servlet can access initialization parameters or handle relative URLs more easily. 28 When changing the default URL, use the servlet-mapping element --> 29 < servlet-mapping ></ servlet-mapping > 30 31 <!-- If a session is not accessed for a certain period of time, the server can discard it to save memory. The timeout value for a single session object can be set explicitly by using HttpSession's 32 setMaxInactiveInterval method, or a default timeout value can be specified using the session-config element --> 33 < session-config ></ session-config > 34 35 <!--If a web application has specific files it wants to be guaranteed to be assigned a specific MIME type, the mime-mapping element provides this guarantee --> 36 < mime-mapping ></ mime-mapping > 37 38 <!-- Instructs the server which file to use when it receives a URL that refers to a directory name instead of a file name --> 39 < welcome-file-list ></ welcome-file-list > 40 41 <!-- when returning a specific HTTP status When you code, or when a specific type of exception is thrown, you can specify the page to be displayed --> 42 < error-page ></ error-page > 43 44 <!-- For Tag Library Descriptor file) to specify an alias. This feature enables you to change the location of TLD files without editing the JSP pages that use these files --> < taglib ></ taglib > 47 48 <!-- Declare a resource-related management object --> 49 < resource-env-ref ></ resource-env-ref > 50 51 <!-- Declare a resource factory External resources used --> 52 < resource-ref ></ resource-ref > 53 54 <!-- Make URLs that should be protected. It is used in conjunction with the login-config element --> 55 < security-constraint ></ security-constraint > 56 57 <! --Specify how the server should authorize users trying to access protected pages. It is used in conjunction with the security-constraint element --> 58 < login-config ></ login-config > 59 60 <!-- Gives a list of security roles that will appear in the role-name subelement of the security-role-ref element within the servlet element. 61 Declare roles separately to make it easier for advanced IDEs to handle security information --> 62 < security-role ></ security-role > 63 64 <!-- declare environment entries for web applications --> 65 < env-entry ></ env-entry > 66 67 <!-- Declare a reference to the EJB's home directory --> 68 < ejb-ref ></ ejb-ref > 69 70 <!Declare an EJB's local home directory application --> 71 < ejb-local-ref > </ ejb-local-ref > 72 73 </ web-app >
web.xml (1) - common elements of web.xml configuration file and their meaning preview
Guess you like
Origin http://10.200.1.11:23101/article/api/json?id=326853464&siteId=291194637
Recommended
Ranking