This might not solve your problem or everyone else's, but I had this same problem occur for me. I had a /mywebapp/session/login URL that I wanted to link to, but <g:link controller="session" action="login">
just resolved to /mywebapp/.
But it turns out that I had mapped my context root "/" to show the login page. I had thought it would redirect, but really it exposed the Session.login page at "/". So, when grails was told to create a link to go to Session.login, the simplest link it could come up with that would take me there was "/". So "/" was correct after all.
If you still can't get it working, but you still need a way to generate links relative to your context root, you can use <a href="${createLink(uri: '/foo/bar')}">