简体   繁体   English

Spring Security UI和grails 2.0

[英]Spring Security UI and grails 2.0

I am not able to use grails security UI(0.1.2) with Grails 2.0. 我无法使用Grails 2.0的Grails安全UI(0.1.2)。 I have googled the possible causes for following error and also have tried suggested fixes but they don't seem to be working. 我已经搜索了导致跟踪错误的可能原因,并尝试了建议的修复程序,但它们似乎没有工作。 I have already tried, overriding the UIs, I also have tried Grails 2.0-m2 version. 我已经尝试过,覆盖UI,我也尝试过Grails 2.0-m2版本。

| Error 2012-01-02 17:17:12,659 ["http-bio-8080"-exec-5] ERROR [/webdemo].[default]  - Servlet.service() for servlet [default] in context with path [/webdemo] threw exception
Message: It looks like you are missing some calls to the r:layoutResources tag. After rendering your page the following have not been rendered: [head]
   Line | Method
->> 886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|   908 | run     in     ''
^   619 | run . . in java.lang.Thread

Following is my main.gsp (some code/comments are removed for brevity) 以下是我的main.gsp(为简洁起见,删除了一些代码/注释)

<head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <title><g:layoutTitle default="Grails"/></title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="shortcut icon" href="${resource(dir: 'images', file: 'favicon.ico')}" type="image/x-icon">
        <link rel="apple-touch-icon" href="${resource(dir: 'images', file: 'apple-touch-icon.png')}">
        <link rel="apple-touch-icon" sizes="114x114" href="${resource(dir: 'images', file: 'apple-touch-icon-retina.png')}">
        <link rel="stylesheet" href="${resource(dir: 'css', file: 'main.css')}" type="text/css">
        <link rel="stylesheet" href="${resource(dir: 'css', file: 'mobile.css')}" type="text/css">
        <g:layoutHead/>
        <r:layoutResources />
    </head>
    <body>
        <div id="grailsLogo" role="banner"><a href="http://grails.org"><img src="${resource(dir: 'images', file: 'grails_logo.png')}" alt="Grails"/></a></div>
        <g:layoutBody/>
        <div class="footer" role="contentinfo"></div>
        <div id="spinner" class="spinner" style="display:none;"><g:message code="spinner.alt" default="Loading&hellip;"/></div>
        <g:javascript library="application"/>
        <r:layoutResources />
    </body>

Add <r:layoutResources /> tag inside <head> and right before </body> . <head></body>之前添加<r:layoutResources />标记。

This is needed by the Grails Resources Plugin and further documentation for the tag can be found here http://grails-plugins.github.com/grails-resources/ref/Tags/layoutResources.html 这是Grails Resources插件所需要的,标签的更多文档可以在这里找到http://grails-plugins.github.com/grails-resources/ref/Tags/layoutResources.html

Try to remove any g:javascript calls (ie the <g:javascript library="application"/> ) and load it via the resources infrastructure instead. 尝试删除任何g:javascript调用(即<g:javascript library="application"/> )并通过资源基础结构加载它。

I am having the exact same problem here (with Grails 2.0.1) and this seems to resolve it. 我在这里遇到完全相同的问题(使用Grails 2.0.1),这似乎解决了它。

If that solution does work for you too, you might want to consider filing a bug report - as this is at least a very confusing error message. 如果该解决方案也适合您,您可能需要考虑提交错误报告 - 因为这至少是一个非常令人困惑的错误消息。

I was having getting the same message It looks like you are missing some calls to the r:layoutResources tag. 我得到了相同的消息 It looks like you are missing some calls to the r:layoutResources tag. with following code 使用以下代码

    <g:javascript library='application' />
    <g:layoutHead/>
    <r:layoutResources />

Fixed when moved <g:javascript/> call between layoutHead and layoutResources 修复了 layoutHead layoutResources 之间 移动 <g:javascript/> layoutResources

    <g:layoutHead/>
          <g:javascript library='application' />
    <r:layoutResources />

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

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