与 HttpSessionListener 接口有关的方法是?

与 HttpSessionListener 接口有关的方法是()
A.sessionInitialized()
B.sessionCreated()
C.sessionFinialized()
D.sessionDestroyed()
答:BD
接口HttpSessionListener有两个方法,分别为:
VoidsessionCreated(HttpSessionEvent se):当session创建时会收到通知。
VoidsessionDestroyed(HttpSessionEvent se):当session销毁时也会收到通知。
根据HttpSessionListener的特性,应用到可以设置session监听,例如:防止用户重复登录,统计用户在线数量,统计用户登录次数等。

猜你喜欢

转载自blog.csdn.net/weixin_40197494/article/details/84346897