Java Grails无法呈现插件中包含的GSP
我有一个名为Java Grails无法呈现插件中包含的GSP,java,grails,groovy,Java,Grails,Groovy,我有一个名为TestPlugin的插件,它在grails应用程序/视图中提供了一个名为\u test-include.GSP的GSP include。我正在将TestPlugin导入TestApp并尝试将其呈现如下: <g:render template="_test-include" plugin="${applicationContext.getBean('pluginManager').getGrailsPlugin('testPlugin')}"/> 我也试过: <
TestPlugin
的插件,它在grails应用程序/视图中提供了一个名为\u test-include.GSP
的GSP include。我正在将TestPlugin
导入TestApp
并尝试将其呈现如下:
<g:render template="_test-include" plugin="${applicationContext.getBean('pluginManager').getGrailsPlugin('testPlugin')}"/>
我也试过:
<g:render template="_test-include" plugin="testPlugin"/>
两者都会导致引发异常。下面是来自Grails的错误报告:
Message: Error mapping onto view [/index]: Error processing GroovyPageView: Error executing tag <g:render>: null
Line | Method
->> 1142 | runWorker in java.util.concurrent.ThreadPoolExecutor
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 617 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run . . . in java.lang.Thread
Caused by GroovyPagesException: Error processing GroovyPageView: Error executing tag <g:render>: null
->> 527 | runWorker in C:\temp\grails-test\test-app\grails-app\views\index.gsp
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Caused by GrailsTagException: Error executing tag <g:render>: null
->> 113 | doCall in C:/temp/grails-test/test-app/grails-app/views/index.gsp
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Caused by NullPointerException: null
->> 936 | get in java.util.concurrent.ConcurrentHashMap
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 141 | getValue in grails.util.CacheEntry
| 81 | getValue in ''
| 58 | doCall in C__temp_grails_test_test_app_grails_app_views_index_gsp$_run_closure2
| 70 | run . . . in C__temp_grails_test_test_app_grails_app_views_index_gsp
| 1142 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 617 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
消息:映射到视图[/index]时出错:处理GroovyPageView时出错:执行标记时出错:null
直线法
->>1142 | java.util.concurrent.ThreadPoolExecutor中的runWorker
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|617 |在java.util.concurrent.ThreadPoolExecutor$Worker中运行
^745 |跑。在java.lang.Thread中
由GroovyPageSexException引起:处理GroovyPageView时出错:执行标记时出错:null
->>527 | C:\temp\grails test\test app\grails app\views\index.gsp中的runWorker
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
由GrailStageException引起:执行标记时出错:null
->>113 | C中的doCall:/temp/grails test/test app/grails app/views/index.gsp
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
由NullPointerException引起:null
->>936 |进入java.util.concurrent.ConcurrentHashMap
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|141 | grails.util.CacheEntry中的getValue
|81 |获取“”中的值
|58 |在C|U temp_grails_test_app_grails_app_view_index_gsp$_run_closure2中记录
|70 |跑。在C_uuutemp_grails_test_app_grails_app_views_index_gsp中
|1142 | java.util.concurrent.ThreadPoolExecutor中的runWorker
|617 |跑。在java.util.concurrent.ThreadPoolExecutor$Worker中
^745 |在java.lang.Thread中运行
不要呈现以开头的模板
这应该起作用:
<g:render template="/test-include" plugin="testPlugin"/>