The Artima Developer Community
Sponsored Link

Artima Developer Spotlight Forum
Deepa Sobhana on the Servlet 3.0 Specification

1 reply on 1 page. Most recent reply: Nov 11, 2008 5:34 AM by Ramesh Mandaleeka

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Frank Sommers

Posts: 2642
Nickname: fsommers
Registered: Jan, 2002

Deepa Sobhana on the Servlet 3.0 Specification Posted: Oct 14, 2008 7:48 PM
Reply to this message Reply

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?

Ramesh Mandaleeka

Posts: 2
Nickname: mandaleeka
Registered: Jun, 2005

Re: Deepa Sobhana on the Servlet 3.0 Specification Posted: Nov 11, 2008 5:34 AM
Reply to this message Reply
Here are the points I can think of.

1) Case insensitive way of accessing request parameters.


String name = request.getParameterIgnoreCase("name");


String name = request.getParameter("name");
2) Generics support

3) Usage of Iterator instead of Enumeration

4)Programming model to support state safety in highly concurrent environments (similar to synchronized methods).

5)Support for Unit testing and Compression on the fly responses (Filters will do the job but direct support in the specification).

6)Alternate approaches to overcome the query string limitations using helper classes or so.

7) Scripting language code injections support in taglibs.


Flat View: This topic has 1 reply on 1 page
Topic: Elliotte Rusty Harold on New Additions to java.lang.Math Previous Topic   Next Topic Topic: Patrick Curran on the JCP Elections

Sponsored Links


Copyright © 1996-2018 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use