getting the request in Grails service

14 views
Skip to first unread message

Sherif Shehab

unread,
Oct 19, 2015, 12:24:49 PM10/19/15
to Grails Dev Discuss
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

Søren Berg Glasius

unread,
Oct 19, 2015, 12:37:51 PM10/19/15
to grails-de...@googlegroups.com
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.

--
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 grails-dev-disc...@googlegroups.com.
To post to this group, send email to grails-de...@googlegroups.com.
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.

Sherif Shehab

unread,
Oct 19, 2015, 12:40:28 PM10/19/15
to grails-de...@googlegroups.com
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 <soe...@glasius.dk> 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: +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 grails-dev-disc...@googlegroups.com.
To post to this group, send email to grails-de...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
On 19 October 2015 at 18:24, Sherif Shehab <sherif...@gmail.com> 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 grails-dev-disc...@googlegroups.com.
To post to this group, send email to grails-de...@googlegroups.com.
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.
Reply all
Reply to author
Forward
0 new messages