In a recent Sun Developer Network article, An Introduction To Servlet 3.0, Deepa Sobhana explains the key new features proposed for the next version of the Java Servlet Specification, currently being developed as JSR 315. Sobhana notes that improved usability and configurability are the main focus areas for Servlet 3.0. For example, deploying servlets in a container can be achieved with annotations in Servlet 3.0:
The Servlet 3.0 API focuses on ease of development by making use of JSR 175 annotations to enable declarative-style programming. This means that you can swiftly develop a servlet or a filter class by simply annotating the class with appropriate annotations like @Servlet or @ServletFilter. Annotations not only make the coding of servlet, filter, and listener classes easier, but also make deployment descriptors optional for a web application, even though the application archive may have servlet, filter, or context listener classes...
Version 3.0 servlets can be implemented as Plain Old Java Objects (POJOs) as opposed to previous versions; i.e., servlets no longer have to extend any of the basic servlet implementation classes like HTTPServlet or GenericServlet... There must be a method annotated with any one of the HttpMethod annotations like GET, PUT, POST, HEAD, or DELETE in the servlet class. These methods should take the HttpServletRequest and HttpServletResponse as method parameters...
Related to ease of use is the desire to enable multiple Web frameworks to co-exist within the same Web application. The Servlet 3.0 specification addresses this requirement with the notion of Web fragments:
Today's web applications support only a single monolithic deployment descriptor wherein we define all deployment information. When the size of the application increases, the dependency on external frameworks may also increase, resulting in complex deployment descriptor files. As you probably know, maintenance of complex descriptors is always a hassle...
In order to resolve these issues, one of Servlet 3.0's most significant concepts is the idea of web fragments or modular web.xml... The framework developers can leverage this feature to define their own web fragments that reside within the framework, and developers can plug in more and more frameworks by just including the library files in the application's classpath, without modifying the existing deployment descriptor. In short, this feature is aimed at having zero configuration when working with frameworks or libraries.
A key new feature in Servlet 3.0 is support for asynchronous request processing:
Servlet 3.0 adds support for suspending and resuming request processing, which enables the servlet to service a request in an asynchronous, non-blocking fashion...
When a request is suspended, the thread handling the request will return to the container without generating any response and gets ready to perform other tasks. The resume method on the request resumes the request processing. Whenever the requested resource becomes available, the thread handling that event resumes the suspended request and proceeds to generate the response.
Additional features in the Servlet 3.0 specification will address security, such as the ability to log in and out of a servlet.
What features would you like to see implemented in the next version of the Servlet Spec?