2014-10-11 59 views
0

使用Grails 2.4.3和Spring安全插件:spring-security-core:2.0-RC4Grails的/ jQuery Mobile的观点登录

默认登录视图auth.gsp工作正常后不显示。
增加了一个用户,可以登录,注销 并查看受保护的页面。

然后我添加JQuery移动文件到我的布局和视图。

我复制到auth.gsp /views/login/auth.gsppastebin
/views/layouts/main.gsp布局看起来像这样pastebin

我的登录页面,如下所示:

enter image description here

当我和无效的凭证登录我得到一个空白页。

enter image description here

之前的页面的源和提交后是完全一样的。 pastebin

如果我删除<script src="http://code.jquery.com/mobile/1.4.4/jquery.mobile-1.4.4.min.js"></script>main.gsp然后我确实看到提交后的输出。

enter image description here

希望有人知道我在做什么错。

UPDATE
plugin/springsecurity/LoginController.groovy

 def authfail() { 

      // .... 

      if (springSecurityService.isAjax(request)) { 
        render([error: msg] as JSON) 
      } 
      else { 
        flash.message = msg 
        redirect action: 'auth', params: params 
      } 
    } 

如果我更改为:

 def authfail() { 
      // ... 

      flash.message = msg 
      redirect action: 'auth', params: params    
    } 

那么它是工作,我再次看到登录视图。

仍然不起作用的是成功登录后的重定向。斯蒂尔看到一个空白页面。

回答