99. Detailed explanation of @WebServlet attributes in Servlet

9. Detailed explanation of @WebServlet attributes in Servlet

In the Servlet, the @WebServlet annotation is set. When the Servlet is requested, the server will automatically read the information in it. If the annotation @WebServlet("/category"), it means that the Servlet default request path is.../category, The urlPatterns attribute name is omitted here. The complete wording should be: @WebServlet(urlPatterns = “/category”). If you need to set multiple attributes in @WebServlet, you must add the attribute name to the attribute value, separated by commas, Otherwise, an error will be reported.

Source https://blog.csdn.net/weixin_45493751/article/details/100559683

Guess you like

Origin blog.csdn.net/weixin_43206161/article/details/111815323