New servlet3.0 features

Source: Internet
Author: User

1. Added annotation support. These annotation are mainly placed in the javax. servlet. annotation package. servlet can not only use these annotation, but also use other general Java annotations.
2. added the servlet modularization function. The official term is Web fragment. That is, a web project can have multiple similar web projects. XML function file, of course, a project can only have one web. XML file, which can have multiple web-fragment. XML file, the server looks for the WEB-INF file from the WEB-INF/classes and web-fragment.xml/lib directory, the WEB-INF file under the web-fragment.xml/lib must be placed under the META-INFA directory of the jar package. Finally, the order of these web-frament. xml files can be specified.
3. Improve the Servlet's metaprogramming capability, that is, dynamically register servlet, filter, and listener. Many methods are added to the javax. servlet. servletcontext interface, such as addservlet, addfilter, and addlistener. These methods can be used to dynamically add servlet, filter, and listener.
4. added direct support for file upload to javax. servlet. HTTP. httpservletrequest added the getpart and getparts methods and added javax. servlet. HTTP. in fact, this function should be provided early to unify the file upload interface.
5. Package the JSP file as a resource file to the jar package and deploy it directly to the WEB-INF/lib directory, which has many benefits to the project of productization development. The JSP file must be placed in a specific directory in the jar package: JAR/META-INF/resources. This directory is specified by the servlet specification and cannot be changed.
6. added javax. servlet. sessioncookieconfig interface supports session tracking customization. We all know that cookie is one of the methods used to implement the session mechanism, and most of the time it is the default preferred method of the server, the default name of the cookie used to implement the session before servlet3.0 is JSESSIONID. The servlet specification does not provide an interface to customize this attribute. I have not seen any benefits of this custom definition for the moment.
7. the most important new feature: Support for asynchronous operations. As a result, the server-side Ajax support is upgraded to the standard level. In the past, servlet-side Ajax support was simulated because of servlet synchronization operations, there must be a return value. Even if the browser does not return any results, the thread must wait until the servlet is executed.

1. Added annotation support. These annotation are mainly placed in the javax. servlet. annotation package. servlet can not only use these annotation, but also use other general Java annotations.
2. added the servlet modularization function. The official term is Web fragment. That is, a web project can have multiple similar web projects. XML function file, of course, a project can only have one web. XML file, which can have multiple web-fragment. XML file, the server looks for the WEB-INF file from the WEB-INF/classes and web-fragment.xml/lib directory, the WEB-INF file under the web-fragment.xml/lib must be placed under the META-INFA directory of the jar package. Finally, the order of these web-frament. xml files can be specified.
3. Improve the Servlet's metaprogramming capability, that is, dynamically register servlet, filter, and listener. Many methods are added to the javax. servlet. servletcontext interface, such as addservlet, addfilter, and addlistener. These methods can be used to dynamically add servlet, filter, and listener.
4. added direct support for file upload to javax. servlet. HTTP. httpservletrequest added the getpart and getparts methods and added javax. servlet. HTTP. in fact, this function should be provided early to unify the file upload interface.
5. Package the JSP file as a resource file to the jar package and deploy it directly to the WEB-INF/lib directory, which has many benefits to the project of productization development. The JSP file must be placed in a specific directory in the jar package: JAR/META-INF/resources. This directory is specified by the servlet specification and cannot be changed.
6. added javax. servlet. sessioncookieconfig interface supports session tracking customization. We all know that cookie is one of the methods used to implement the session mechanism, and most of the time it is the default preferred method of the server, the default name of the cookie used to implement the session before servlet3.0 is JSESSIONID. The servlet specification does not provide an interface to customize this attribute. I have not seen any benefits of this custom definition for the moment.
7. the most important new feature: Support for asynchronous operations. As a result, the server-side Ajax support is upgraded to the standard level. In the past, servlet-side Ajax support was simulated because of servlet synchronization operations, there must be a return value. Even if the browser does not return any results, the thread must wait until the servlet is executed.
1. Added annotation support. These annotation are mainly placed in the javax. servlet. annotation package. servlet can not only use these annotation, but also use other general Java annotations.
2. added the servlet modularization function. The official term is Web fragment. That is, a web project can have multiple similar web projects. XML function file, of course, a project can only have one web. XML file, which can have multiple web-fragment. XML file, the server looks for the WEB-INF file from the WEB-INF/classes and web-fragment.xml/lib directory, the WEB-INF file under the web-fragment.xml/lib must be placed under the META-INFA directory of the jar package. Finally, the order of these web-frament. xml files can be specified.
3. Improve the Servlet's metaprogramming capability, that is, dynamically register servlet, filter, and listener. Many methods are added to the javax. servlet. servletcontext interface, such as addservlet, addfilter, and addlistener. These methods can be used to dynamically add servlet, filter, and listener.
4. added direct support for file upload to javax. servlet. HTTP. httpservletrequest added the getpart and getparts methods and added javax. servlet. HTTP. in fact, this function should be provided early to unify the file upload interface.
5. Package the JSP file as a resource file to the jar package and deploy it directly to the WEB-INF/lib directory, which has many benefits to the project of productization development. The JSP file must be placed in a specific directory in the jar package: JAR/META-INF/resources. This directory is specified by the servlet specification and cannot be changed.
6. added javax. servlet. sessioncookieconfig interface supports session tracking customization. We all know that cookie is one of the methods used to implement the session mechanism, and most of the time it is the default preferred method of the server, the default name of the cookie used to implement the session before servlet3.0 is JSESSIONID. The servlet specification does not provide an interface to customize this attribute. I have not seen any benefits of this custom definition for the moment.
7. the most important new feature: Support for asynchronous operations. As a result, the server-side Ajax support is upgraded to the standard level. In the past, servlet-side Ajax support was simulated because of servlet synchronization operations, there must be a return value. Even if the browser does not return any results, the thread must wait until the servlet is executed.

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.