GWT 页面上的 GWT 与 Spring Security 缓存问题
我觉得这很奇怪,我无法找到有类似问题的人的任何信息。无论如何,我已经将 Spring Security 与 GWT 集成,并且它似乎在大多数情况下都能正常工作。我在 IE 和 Chrome 中遇到了 html 主页面的缓存问题。
我已将 Spring Security 登录分离到一个 login.jsp 中,该登录会重定向到我的 Application.html 页面(GWT 页面),当我第一次启动应用程序并访问该页面时,它似乎在所有浏览器中都能正常工作。我被定向到登录页面,因为我没有经过身份验证。
问题是,在 Chrome 或 IE 中,如果我在成功登录后关闭浏览器,并直接浏览回该 Application.html URL,它仍然呈现为好像我已通过身份验证一样。我查看控制台,Spring Security 的日志语句验证我没有经过身份验证。当我按 f5 刷新页面时,我被引导回 login.jsp url。
我相信这是一些缓存问题,因为当我关闭浏览器并重新打开 html 页面时,即使它呈现得像我已登录,控制台日志语句却说我没有登录,并且如果我运行调试模式下,Application.java 中的 OnModuleLoad() 永远不会被命中。
最后,这似乎在 Firefox 中可以正常工作...如果有人看到这个问题或对我需要修复的地方有任何建议,我将非常感谢您的帮助。
I find this kind of odd I haven't been able to find any information on someone with a similar issue. Anyway, I've integrated Spring Security with GWT, and it appears to work correctly...for the most part. I'm having a caching issue with the main html page in IE and Chrome.
I've separated out Spring Security login to a login.jsp that redirects to my Application.html page (the GWT page), and when I first start the app and access the page, it appears to be working fine in all browsers. I get directed to the login page, because I'm not authenticated.
The issue is that in Chrome or IE, if i close the browser after a successful login, and directly browse back to that Application.html URL, it still renders as if I'm authenticated. I look in my console, and the log statements for spring security verify I am not authenticated. The moment i hit f5 to refresh the page, I get directed back to the login.jsp url.
I'm lead to believe this is some caching issue because when I close the browser and reopen to the html page, even though it renders like I'm logged in, the console log statements say I'm not, and if I run in debug mode, the OnModuleLoad() in Application.java never gets hit.
Finally, this appears to work properly in firefox...If anyone has seen this issue or has any advice of where I need to look to fix, I would greatly appreciate the assistance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在开发的网络应用程序中遇到了类似的问题。我尝试通过将这些标签添加到页面来阻止浏览器缓存页面:
不幸的是,这不足以阻止所有浏览器的缓存。我最终将页面转换为 JSP 页面,并将这些语句添加到顶部:
自从我进行更改以来,我无法在 Firefox、Chrome 或 Safari 中重现该问题。我还没有使用 Internet Explorer 测试该页面。
I've encountered a similar problems with a web app that I've been working on. I attempted to prevent the browser from caching the page by adding these tags to the page:
Unfortunately, this wasn't enough to prevent caching for all browsers. I finally ended up converting the page to a JSP page and adding these statements to the top:
I haven't been able to reproduce the problem in Firefox, Chrome or Safari since I made the change. I haven't tested the page with Internet Explorer yet.