Servlet与会话Bean 的之间关系
今天终于通过《EJB 3.0专家编程》得知了Servlet 与 SessionBean 之间的关系。
原来Servlet 与 SessionBean 不是一回事。HTTP会话是关联一个会话id的数据的map。当应用请求创建一个会话时,服务器生成一个新的id,返回一个HTTPSession对象,应用可以用它来存储键/值数据对。然后它使用诸如浏览器Cookies的技术把会话id与客户端关联起来,把两者捆绑到一次会话中。对于Web应用,客户端很大程度上不会知道服务器端追踪的对话状态。
———————————————————————————————————————
TheRelationship Between Servlet and SessionBean
Not to be confused with the session bean, the HTTP session is a map of data associated with a session id. When the application requests that a session be created, the server generates a new id and returns an HTTPSession object that the application can use to store key/value pairs of data. It then uses techniques such as browser cookies to link the session id with the client, tying the two together into a conversation. For web applications, the client is largely ignorant of the conversational state that is tracked by the server.