谁能知道如何将字符串作为参数传递给 grailsApplication.config。
I have tried the following.
class ConfigPropertiesLoader {
def grailsApplication
def getProperty(String property ){
def properties=grailsApplication.config.${property}
return properties;
}
这是我得到的错误,
Error 2013-02-13 12:59:29,850 [http-bio-8080-exec-10] ERROR 0].[grails] - Servlet.service() for servlet grails threw exception
Message: Cannot get property 'config' on null object
Line | Method
->> 30 | getProperty in com.nagra.ms.sam.config.ConfigPropertiesLoader$$ENxJABt5
| 51 | <init> in com.nagra.ms.sam.entity.account.controller.AccountController
| 196 | getBean . . . . in grails.plugin.cache.web.filter.AbstractFilter
| 842 | lookupController in grails.plugin.cache.web.filter.PageFragmentCachingFilter
| 176 | doFilter . . . . in ''
| 63 | doFilter in grails.plugin.cache.web.filter.AbstractFilter
| 1110 | runWorker . . . in java.util.concurrent.ThreadPoolExecutor
| 603 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run . . . . . . in java.lang.Thread