我有一个名为TestPlugin的插件,它在grails-app/views中提供了一个名为_test-include.gsp的普惠制包含。我将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发布于 2014-10-08 21:08:48
不要从_开始呈现模板。
这应该是可行的:
<g:render template="/test-include" plugin="testPlugin"/>https://stackoverflow.com/questions/26266326
复制相似问题