为啥每次点init或destroy按钮都会重新创建session,运行结果如下:
1.进入index.jsp
requestInitialized : name = null
ServletRequest_attributeReplaced: org.apache.catalina.ASYNC_SUPPORTED
sessionCreated
requestDestroyed
2.第一次点击init按钮
requestInitialized : name = null
ServletRequest_attributeReplaced: org.apache.catalina.ASYNC_SUPPORTED
sessionCreated
ServletRequest_attributeAdded: requestName
HttpSession_attributeAdded: sessionName
ServletContext_attributeReplaced: applicationName
requestDestroyed
3.第二次点击init按钮
requestInitialized : name = null
ServletRequest_attributeReplaced: org.apache.catalina.ASYNC_SUPPORTED
sessionCreated
ServletRequest_attributeAdded: requestName
HttpSession_attributeAdded: sessionName
ServletContext_attributeReplaced: applicationName
requestDestroyed
4.点击destroy按钮
requestInitialized : name = null
ServletRequest_attributeReplaced: org.apache.catalina.ASYNC_SUPPORTED
sessionCreated
HttpSession_attributeAdded: sessionName
ServletContext_attributeReplaced: applicationName
requestDestroyed