Session lifecycle events

The sesssin was created:
when the Container first creates a session,At this point ,the session is still considered new(in other words ,the client has not yet sent a request with the session ID)
the session was destroyed by calling the session's invalidate() method.

Attributes:

an attribute was added:
when some part of the app calls setAttribute() on session.

an attribute was removed:
when some part of the app calls removeAttribute() on the session.

an attribute was replaced
when some part of the app calls setAttribute() on the session,and the name of the attribute has already be bound to the session.

[size=large]Migration:[/size]
The session is about to be passivated
when the Container is about to migrate (move) the session into a different VM.Called before the session moves ,so that attributes have a chance to prepare themselves for migration.

the session has been activated
When the Container has just migrated (moved)the session into a different VM.Called before any other part of the app can call getAttribute() on the session ,so the just-moved attributes have a chance to get themselves ready for access.

Only HttpSession objects move from one VM to another.
There is one ServletContext per VM,There is one ServletConfig per servlet,per VM.
But there is only one HttpSession object for a given session ID per web app,regardless of how many VM's the app is distributed across.

if the vendor does support distributed apps ,then the Container is required to migrate sessions across VMs.And that includes migrating session attributes as well
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值