I have a service class and i am trying to call the method of the service in my controller as below.
class LogListController {
def ListLogDetails = {
println "We are inside List log Details-->"+params
def logListHelperService
logListHelperService.getFilePath(params)
}}
Exception Message: Cannot invoke method getFilePath() on null object
what is my mistake there..
def logListHelperService
must be declared outside of the ListLogDetails definition
def logListHelperService
def ListLogDetails = {
println "We are inside List log Details-->"+params
logListHelperService.getFilePath(params)
}
should work
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With