Using taglib functions in services

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Using taglib functions in services

Nicolas R.-2
Hi folks,

I would like to use the createLink Function in my Service-Class. This
doesn't work out-of-the-box, like it would in a Controller-Class.
Which packets do I have to include?

Thanks in advance,

Nicolas

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Using taglib functions in services

Lee Butts
Hi Nicolas,

you can get the taglib from the main applicationContext via:

grailsApplication.mainContext.getBean('org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib')

just inject grailsApplication into your service via:

def grailsApplication

cheers

Lee


2009/5/10 Nicolas R. <[hidden email]>
>
> Hi folks,
>
> I would like to use the createLink Function in my Service-Class. This
> doesn't work out-of-the-box, like it would in a Controller-Class.
> Which packets do I have to include?
>
> Thanks in advance,
>
> Nicolas
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>   http://xircles.codehaus.org/manage_email
>
>

Loading...