Servlet 2.4 Specification Proposed Final Draft 2 is out


News: Servlet 2.4 Specification Proposed Final Draft 2 is out

  1. After 7 months since the first proposed final draft (PFD) of the servlet 2.4 specification came out, but today PFD2 was released with numerous fixes and clarifications.

    Overall, the Servlet 2.4 spec is mostly a maintenance release. PFD1 introduced portable logout, new lifecycle listeners and minor filter and security enhancements. PFD2 diverges from PFD1 with the following changes:

    Extensibility of deployment descriptor was removed
    PFD 1 had a cool new feature that allowed developers or architects of presentation layer frameworks to extend web.xml with new, application specific configuration elements. It would help puts configuration data in one place, simplifying the maintenance and administration of the web tier. For some reason, this feature was removed in PFD2.

    New parameter for forwarded requests
    A servlet that has been invoked by another servlet using the forward method of RequestDispatcher now has access to the path of the original request.

    Single thread model is deprecated
    The single thread model interface option has been deprecated because SingleThreadModel does not solve all thread safety issues. For example, session attributes and static variables can still be accessed by multiple
    requests on multiple threads at the same time, even when SingleThreadModel servlets are used. It is recommended that a developer take other means to resolve those issues instead of implementing this interface, such as avoiding the usage of an instance variable or synchronizing the block of the code accessing those resources.

    New methods in ServletRequest interface and ServletRequestWrapper
    The following methods have been added to the ServletRequest interface and ServletRequestWrapper:

    getLocalAddr(). Returns the Internet Protocol (IP) address of the interface on which the
    request was received.
    getLocalName(). Returns the host name of the Internet Protocol (IP) interface on which the
    request was received.
    getLocalPort(). Returns the Internet Protocol (IP) port number of the interface on which the
    request was received.
    getRemotePort(). Returns the Internet Protocol (IP) source port of the client or last proxy that
    sent the request.

    You can download the spec here:
  2. Is the next JSP version going to deprecate the isThreadSafe page directive?