站内搜索: 请输入搜索关键词
当前页面: 图书首页 > Java2 Platform Enterprise Edition Platform And Component Specifications

Java2 Platform Enterprise Edition Platform And Component Specifications

[ directory ] Previous Section Next Section

J2EE.6.6 Servlet 2.2 Requirements

Servlet 2.2 extends Servlet 2.1 with support for the packaging and deployment of web applications, standalone and as part of a J2EE application. Servlet 2.2 also addresses security, both standalone and within the J2EE platform, and provides support for the notion of a web application.

The Servlet 2.2 specification defines distributable web applications. To support J2EE applications that are distributable, this specification adds the following requirements.

A distributable application may only place objects of the following types into a javax.servlet.http.HttpSession object using the setAttribute or putValue methods:

  • java.io.Serializable

  • javax.ejb.EJBObject

  • javax.ejb.EJBHome

  • javax.transaction.UserTransaction

  • a javax.naming.Context object for the java:comp/env context

Web containers may throw an IllegalArgumentException if an object that is not one of the above types is passed to the setAttribute or putValue methods of an HttpSession object corresponding to a distributable session. This exception indicates to the programmer that the web container does not support moving the object between VMs. A web container that supports multi-VM operation must ensure that, when a session is moved from one VM to another, all objects of the above types are accurately recreated on the target VM.

The Servlet 2.2 specification is included in this volume.

    [ directory ] Previous Section Next Section