我只想在用戶在我的web應用程序中成功驗證時創建會話。但由於某種原因,即使我們只是訪問登錄頁面,struts2也會創建會話對象。struts2創建會話對象,爲什麼和什麼時候?
我仔細閱讀了一些關於struts2的文檔,發現使用struts.custom.i18n.resources可能會創建會話。所以我從struts.xml文件中刪除了它。但即使會話正在我的Web應用程序中創建。
對此的任何幫助/想法都非常感謝。
更新問題
我曾在我的web.xml以下行與卡宴數據方面的工作。
<filter>
<filter-name>CayenneFilter</filter-name>
<filter-class>org.apache.cayenne.conf.WebApplicationContextFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>CayenneFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
這是否會導致在我的Web應用程序中創建會話?
-Narendra
請重新說明_struts2創建會話對象的問題,爲什麼以及何時。 –
http://stackoverflow.com/questions/2255814/can-i-turn-off-the-httpsession-in-web-xml可能有幫助 –
應用程序服務器負責創建和管理會話而不是struts 2.沒有點試圖禁用此,請參閱Davids的答案。 – Quaternion