layoutTitle标记问题

时间:2012-08-30 18:16:24

标签: grails gsp

我正致力于一个grails项目。所以在它的主要布局页面中有一个字符串

 <title>CHP: <g:layoutTitle /></title>

并且每个视图页面都有一个标题标记。但我发现在HelperMethodsTagLib(在同一命名空间内)中的layoutTitle标签被覆盖:

def layoutTitle = { attrs, body ->
        try {
            out << this.pageScope.settedPageTitle
        } catch (Exception e) {
            out << "Default"
        }
    }

此实现不起作用,因此每个页面都有标题CHP:Default。 删除此实现会导致应用程序失败:

 2012-08-30 20:53:40,580 [http-8080-2] ERROR chp.HomeController  - org.codehaus.groovy.grails.web.errors.GrailsWrappedRuntimeException
2012-08-30 20:53:40,591 [http-8080-2] ERROR pages.GroovyPagesServlet  - Error processing GSP: Error executing tag <g:layoutTitle>: java.lang.StackOverflowError at /home/aggressor/Job/chp/trunk/grails-app/views/layouts/user_page.gsp:5
org.codehaus.groovy.grails.web.taglib.exceptions.GrailsTagException: Error executing tag <g:layoutTitle>: java.lang.StackOverflowError at /home/aggressor/Job/chp/trunk/grails-app/views/layouts/user_page.gsp:5
    at home_aggressor_Job_chp_trunk_grails_app_views_layouts_user_page_gsp$_run_closure1_closure3.doCall(home_aggressor_Job_chp_trunk_grails_app_views_layouts_user_page_gsp:23)
    at home_aggressor_Job_chp_trunk_grails_app_views_layouts_user_page_gsp$_run_closure1_closure3.doCall(home_aggressor_Job_chp_trunk_grails_app_views_layouts_user_page_gsp)
    at home_aggressor_Job_chp_trunk_grails_app_views_layouts_user_page_gsp$_run_closure1.doCall(home_aggressor_Job_chp_trunk_grails_app_views_layouts_user_page_gsp:25)
    at home_aggressor_Job_chp_trunk_grails_app_views_layouts_user_page_gsp$_run_closure1.doCall(home_aggressor_Job_chp_trunk_grails_app_views_layouts_user_page_gsp)
    at home_aggressor_Job_chp_trunk_grails_app_views_layouts_user_page_gsp.run(home_aggressor_Job_chp_trunk_grails_app_views_layouts_user_page_gsp:40)
    at java.lang.Thread.run(Thread.java:722)
Caused by: org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.StackOverflowError
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    ... 6 more
Caused by: java.lang.StackOverflowError
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)
    at chp.HelperMethodsTagLib.getProperty(chp.HelperMethodsTagLib)

0 个答案:

没有答案