Sherif
Sherif

Reputation: 431

getting the request in Grails service

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

Answers (1)

Ari Bustamante
Ari Bustamante

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

Related Questions