设置 jboss Valve 是唯一的方法吗?
我有一个使用 jaas 模块设置的应用程序用于登录。应用程序中有ajax函数调用,所以我遇到了臭名昭著的ajax会话超时问题,这意味着如果会话超时,丑陋的登录页面将进入页面的占位符。我现在通过检查返回的ajax结果是否包含登录表单以一种丑陋的方式修复它,但显然,这不是一个好方法。
我尝试添加一个过滤器来检查会话是否超时并返回对 ajax 请求有意义的内容。但 jaas 似乎先于 servlet 过滤器运行。我已经检查并确认 Valve 是某种在 jaas 之前运行的“拦截器”。这似乎是我需要的东西。但它是基于容器的而不是基于应用程序的,在我看来,这不是那么适合应用程序。所以我问这是否是实现我想做的事情的唯一方法,或者是否有更好的选择。
我正在使用 Jboss AS 4.2.3
谢谢。
I have an application set up using jaas module for login. There are ajax function calls in the application so I am experencing the notorious ajax session timeout problem, which means a ugly login page is getting into a page's place holder if session is timeout. I am now fixing it in an ugly way by checking if the return ajax result contains the login form, but apparently, this is not a good way.
I tried to add a filter to check if session has timed out and return something meaningful for ajax request. But it seems that jaas runs prior to servlet filters. I have checked and acknowledged valve is some kind of "interceptor" which runs before jaas. It seems to be the thing I needed.But it's container-base not application-based, which is not so application-frieldly IMO. So I am asking if this is the only way to fulfil what I am trying to do or are there any better alternatives.
I am using Jboss AS 4.2.3
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在我看来,这个问题没有真正的解决方案。 JAAS根本没有考虑使用ajax的会话超时。
我们只能粗略地检查ajax响应是否包含登录页面元素来检测会话是否超时。
我会将其标记为答案。如果有更好的答案,我很乐意标记。
It seems to me there's no real solution to this problem. JAAS didn't consider session timeout using ajax at all.
We can only dirtily check if the ajax response contains the login page elements to detect if session is timeout or not.
I will mark this as answer. And I am happy to mark a better answer if there's any to come.