web.xml configuration and description

web.xml configuration and description


	<servlet>
		<servlet-name>NowListServlet</servlet-name>
		<servlet-class>com.budaye.management.self.servlet.NowListServlet</servlet-class>
	</servlet>
	<servlet-mapping>
		<servlet-name>NowListServlet</servlet-name>
		<url-pattern>/nowlist</url-pattern>
	</servlet-mapping>

The matching process of the servlet container to the URL requires the servlet-mapping configuration item.

  • servlet-name: Same as the servlet-name in the servlet tag.
  • url-pattern: indicates the access address of the service after removing the base url (the context path of the url). For example, the complete url in this example is: http://localhost:8088/management/nowlist. When I am asked to use the url, I will find the corresponding service through the url-pattern attribute.

It should be noted here that the @WebServlet annotation items defined in the code class should be deleted, otherwise, in eclipse, an error will be reported during debugging.

[External link image transfer failed. The source site may have an anti-leech link mechanism. It is recommended to save the image and upload it directly (img-G87Do6p1-1611113272157)(evernotecid://6FE75482-54A0-433A-9625-A01F7FEE92EC/appyinxiangcom/9896050/ENResource /p3006)]


PS: For more more content..., please check --> "Server Development"
PS: More more content..., please check --> "Server Development"
PS: More more content..., please check --> "Server Development"

Guess you like

Origin blog.csdn.net/u011578734/article/details/112860933