Ajax调用不续订会话超时在Tomcat 6Ajax、Tomcat

2023-09-10 19:01:06 作者:就这样、离去

我迁移我的web应用程序从Tomcat 5.5到Tomcat 6(.0.32)。在该应用程序有每尾页ajax调用,以避免会话超时。它工作正常,在Tomcat 5.5,但它并没有在Tomcat中6工作,我使用过滤器来跟踪在数据库表中的每个电话。在非Ajax调用,我可以看到在跟踪表和复位会话超时。在Ajax调用,我可以看到跟踪表中,但不是会话超时的复位。

I migrated my webapp from Tomcat 5.5 to Tomcat 6(.0.32). In that app there are ajax calls in every footer page to avoid session timeout. It works fine on Tomcat 5.5 but it doesn't work in Tomcat 6. I use a filter to track every call in a DB table. On non-ajax calls I can see the tracking in the table and the reset session timeout. On ajax calls I can see the tracking in the table but not the reset of the session timeout.

为什么呢?我可以改变这种行为?而且,只为信息,怎么能分辨的tomcat6 Ajax调用?

Why? Can I change this behavior? And, just for info, how can Tomcat6 distinguish the ajax calls?

推荐答案

如果你没有明确访问会话响应AJAX调用,您可能需要设置的 org.apache.catalina.STRICT_SERVLET_COMPLIANCE 系统属性。当然,这也可能会影响你的应用程序的其他部分。另一种选择是,以确保你明确地访问会话...

If you're not explicitly accessing the session in response to the AJAX calls, you may need to set the org.apache.catalina.STRICT_SERVLET_COMPLIANCE system property. Of course, that may also impact other parts of your app. Another option would be to ensure that you do explicitly access the session...