Grails jQuery Mobile应用程序中的Spring Security Refresh Error

Sea*_*ens 2 grails spring-security jquery-mobile

我有一个Grails 2.0.1 jQuery Mobile应用程序,这是我第一次使用Spring Security.我遵循了Peter Ledbrook的帖子中的优秀指示.

成功登录后,使用应用程序和安全控件正常工作.但是,如果用户执行浏览器刷新,则会发生AuthenticationServiceException.

登录后浏览器中显示的URL是我的应用程序的根加上/ j_spring_security_check

http://localhost:8080/myapp/j_spring_security_check
Run Code Online (Sandbox Code Playgroud)

为什么这会附加到我的网址?如果我手动编辑URL并指向应用程序的根目录,那么浏览器重新加载就没有问题.

小智 5

尝试设置data-ajax='false'形成元素

<form id="loginForm" name='f' action="<c:url value='/j_spring_security_check' />"
                method='POST'  data-ajax="false">
Run Code Online (Sandbox Code Playgroud)