1. Configure the web.xml file
First <url-pattern>
intercept the request, then look for the same name as <servlet-mapping>
in , and then jump to his<servlet-name>
<servlet->
<servlet-class>
2. Annotation method (Servlet3.0)
It is no longer necessary to configure in web.xml, just write the following code at the beginning of the servlet.
@WebServlet(name = "xxx(一般系统自动生成)",urlPatterns = {"/xxx"})