[英]Spring Security UI and grails 2.0
我無法使用Grails 2.0的Grails安全UI(0.1.2)。 我已經搜索了導致跟蹤錯誤的可能原因,並嘗試了建議的修復程序,但它們似乎沒有工作。 我已經嘗試過,覆蓋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
以下是我的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…"/></div>
<g:javascript library="application"/>
<r:layoutResources />
</body>
在<head>
和</body>
之前添加<r:layoutResources />
標記。
這是Grails Resources插件所需要的,標簽的更多文檔可以在這里找到http://grails-plugins.github.com/grails-resources/ref/Tags/layoutResources.html
嘗試刪除任何g:javascript調用(即<g:javascript library="application"/>
)並通過資源基礎結構加載它。
我在這里遇到完全相同的問題(使用Grails 2.0.1),這似乎解決了它。
如果該解決方案也適合您,您可能需要考慮提交錯誤報告 - 因為這至少是一個非常令人困惑的錯誤消息。
我得到了相同的消息 It looks like you are missing some calls to the r:layoutResources tag.
使用以下代碼
<g:javascript library='application' />
<g:layoutHead/>
<r:layoutResources />
修復了 在 layoutHead
和 layoutResources
之間 移動 <g:javascript/>
layoutResources
<g:layoutHead/>
<g:javascript library='application' />
<r:layoutResources />
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.