springboot session监听

springboot为什么我监听session无效啊
图片说明图片说明是第一种方式
图片说明第二种直接用@WebListener为什么都无效
请问一下有什么错误或者其他的关注点我没有注意到的么

如果不用注解的话是需要在web.xml中配置listener,如下,并且需要在web.xml文件中设置metadata-complete=true。
当使用spring boot时,没有配置metadata-complete属性,所以才无效。


com.xxx.SessionListener

参考文章:
https://blog.csdn.net/hotdust/article/details/52993137

spring boot之session的创建,销毁,超时,监听等等小结
https://blog.csdn.net/east123321/article/details/79157464