Grails Link generation - relative urls

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

Grails Link generation - relative urls

Thomas Lefevre
In DefaultLinkGenerator line 258 and forward, the generation of relative urls is handled. In line 261 there's an if statement, that checks if you have provided a base url or if a context path is either provided or present. If either is the case, absolute urls are forced. 

In my present project, the application is in the root of the web container and I have not provided a base url. As such, I can not create relative urls for my application. 

I understand that if you provide a base url, that this is in contradiction to the absolute flag of the link generator and as such it overrides the absolute flag. However, I can not figure out why absolute urls are forced if there is no context path for the application. 

Can anyone enlighten me?

So far, we have simply resorted to generating the url and then removing the host part of the generated url. Ugly, but it gets the job done.

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
For more options, visit