@webservlet annotations provided by Servlet3.0:
The @webservlet annotations provided by servlet3.0 are used to annotate a class as a servlet class, simplifying the servlet configuration on Web. Xml.
@WebServlet related properties of annotations
1. asyncsupported: Declares whether the servlet supports asynchronous operation mode
2, Description:servlet description of information
3. Display name of Displayname:servlet
4. Initialization parameters of Initparams:servlet
5, the name of Name:servlet
6. Urlpatterns:servlet Access URL (specifies the URL of the servlet's access to the browser)
7. Value:servlet Access URL
8. Loadonstartup: Specifies whether the servlet should be loaded at startup (it must be guaranteed that value or urlpatterns have values, otherwise, it needs to be configured with the traditional servlet configuration, which is configured in Web. xml)
Note:
The servlet's access URL is a required attribute of the servlet and can optionally be defined using Urlpatterns or value.
Like the Servlet3demo above can be described as @webservlet (name= "Servlet3demo", value= "/servlet3demo").
Also defines multiple URL accesses:
such as @webservlet (name= "Servlet3demo", urlpatterns={"/servlet3demo", "/servlet3demo2"})
or @webservlet (name= "Annotationservlet", value={"/servlet3demo", "/servlet3demo2"})
@webservlet note reference parameter details provided by Servlet3.0