Sunday, 27 May 2012

If you're thinking of using grailsLinkGenerator in Bootstrap.groovy

In Grails 2, the creators have made it easier for us developer to create the urls in our service/taglib classes.

One would use it like this:



 class MyService { 
      LinkGenerator grailsLinkGenerator
     ...
 }  



However, after some investigation, it seems that at the point where Bootstrap.groovy is run, it doesn't have access  to the contextual information such as the host name and context path. So even though you can inject this class to Bootstrap.groovy, it doesn't provide us with much contextual information.


No comments:

Post a Comment