@webservlet note reference parameter details provided by Servlet3.0

Source: Internet
Author: User

@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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.