我在我的main.gsp
中包含了部分模板。使用視圖下的部分模板根
對於網站上的每個控制器/頁面,此部分內容略有不同。 因此,我將爲每個視圖目錄分別提供_headerDetails.gsp
。
這工作正常,除了默認應用程序index.gsp
。 當我包括_headerDetails.gsp
下根視圖目錄,我得到以下錯誤:
org.codehaus.groovy.grails.web.pages.exceptions.GroovyPagesException: Error processing GroovyPageView: Template not found for name [headerDetails] and path [//_headerDetails.gsp]
是否Grails的不允許在根目錄下的諧音?
Main.gsp
<html>
<head>
<g:layoutTitle/>
<r:layoutResources/>
<link href="${resource(dir: 'css', file: 'style.css')}" type="text/css" rel="stylesheet">
</head>
<body class="home">
<div id="wrapper">
<div id="page_top"></div>
<div id="content">
<g:render template="/common/header" />
<g:render template="headerDetails" />
<br class="clear" />
<g:layoutBody/>
<br class="clear" />
</div>
<div id="page_bottom"></div>
<g:render template="/common/footer" />
</div>
<r:layoutResources/>
</body>
</html>
這個問題,它的答案,幫助我。未能看到它是如何「太本地化」。無論如何感謝過度緩和。 – 2014-07-09 13:33:29