Reputation: 431
In Grails Service i'm trying to get the request but i'm getting the below error :
No such property: theRequest for class: com.sherif.utils.MyService
here is my code in the service:
def theRequest = WebUtils.retrieveGrailsWebRequest().getCurrentRequest()
anything missing ?
Thanks
Upvotes: -1
Views: 1420
Reputation: 124
You might try this instead:
def getTheRequest() {
WebUtils.retrieveGrailsWebRequest().getCurrentRequest()
}
You should be able to call that the same way as a property:
myService.theRequest
Upvotes: 0