简体   繁体   English

配置tomcat会话管理器以忽略特定请求

[英]Configure a tomcat session manager to ignore particular requests

I'm trying to configure a context.xml such that my custom AWS DynamoDB session manager doesn't attempt to create sessions for particular requests (eg mobile ones). 我正在尝试配置context.xml ,以使我的自定义AWS DynamoDB会话管理器不会尝试为特定请求(例如,移动请求)创建会话。

This seems like a natural enough role for a Valve entity. 对于Valve实体,这似乎很自然。 The valve listens for particular requests and sets some state that signals action or inaction to the rest of the session management system. 阀门监听特定的请求,并设置一些状态,该状态向会话管理系统的其余部分发出活动或不活动的信号。 However, I can't figure out where that state ought to be. 但是,我不知道该状态应该在哪里。 Is there a consensus right way to do this? 有达成共识的正确方法吗?

Your need to find the place in your own application where the sessions are being created, and stop them from being created there . 您需要在自己的应用程序中找到创建会话的位置,并阻止在那里创建会话。 Unless you are using FORM authentication, Tomcat will never create a session for a request unless your application specifically calls HttpServletRequest.getSession(true) . 除非您使用FORM身份验证,否则Tomcat绝不会为请求创建会话,除非您的应用程序专门调用HttpServletRequest.getSession(true)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM