getting the request in Grails service

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

getting the request in Grails service

sshehab
Hi all , 

In Grails 2.5.1 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()


Thanks
Sherif

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/df0fcf38-eac0-470b-b9e5-5ff770a3b91d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Thanks Sherif
Reply | Threaded
Open this post in threaded view
|

Re: getting the request in Grails service

sbglasius
Hi Sherif,

Is that inside our outside a method? My best bet is, that the above code should work. 


Best regards / Med venlig hilsen,
Søren Berg Glasius

Hedevej 1, Gl. Rye, 8680 Ry, Denmark
Mobile: +45 40 44 91 88, Skype: sbglasius
--- Press ESC once to quit - twice to save the changes.

On 19 October 2015 at 18:24, Sherif Shehab <[hidden email]> wrote:
Hi all , 

In Grails 2.5.1 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()


Thanks
Sherif

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/df0fcf38-eac0-470b-b9e5-5ff770a3b91d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/CAGY%2BWWR%2BKHiHxkCLXUGsX6fKhiy96%3D%2B2fPz8A2TukO3odmPTug%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: getting the request in Grails service

sshehab
Hi ,

it is inside the method.should i get it outside it to work ?

Thanks
Sherif

On Mon, Oct 19, 2015 at 6:37 PM, Søren Berg Glasius <[hidden email]> wrote:
Hi Sherif,

Is that inside our outside a method? My best bet is, that the above code should work. 


Best regards / Med venlig hilsen,
Søren Berg Glasius

Hedevej 1, Gl. Rye, 8680 Ry, Denmark
Mobile: <a href="tel:%2B45%2040%2044%2091%2088" value="+4540449188" target="_blank">+45 40 44 91 88, Skype: sbglasius
--- Press ESC once to quit - twice to save the changes.


--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/CAGY%2BWWR%2BKHiHxkCLXUGsX6fKhiy96%3D%2B2fPz8A2TukO3odmPTug%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

On 19 October 2015 at 18:24, Sherif Shehab <[hidden email]> wrote:
Hi all , 

In Grails 2.5.1 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()


Thanks
Sherif

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/df0fcf38-eac0-470b-b9e5-5ff770a3b91d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/CALtz5ryfFFJqg5EfUt%2BKGzBBvq6r7z0%2BUAQ%3DKTmb-a2t2Gxxxg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Thanks Sherif