Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3240536
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:05:48+00:00 2026-05-17T18:05:48+00:00

The <g:link controller=foo action=bar>foobar</g:link> tag sometimes works, that is is renders as <a href=grailsapp/foo/bar>foobar</a>

  • 0

The

<g:link controller="foo" action="bar">foobar</g:link>

tag sometimes works, that is is renders as

<a href="grailsapp/foo/bar">foobar</a>

and sometimes it doesn’t. In this case I’ll get a

<a href="grailsapp/">foobar</a>

Does anyone know what conditions cause this tag to fail to expand? Also is there any way to debug the tag expansion logic?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T18:05:48+00:00Added an answer on May 17, 2026 at 6:05 pm

    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')}">

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a link <a id=DownloadLink href='controller/action' target=_blank>Download File</a> that has to open a
I have this link: <a href=<?php echo $this->url(array('controller'=>'index','action'=>'form'),NULL,TRUE);?>> Form </a> With this I get
I have a site that have URL similar to this: /mysite/admin/controller/action/id /mysite/search/controller/action/id /mysite/user/controller/action/id I
I have an action in my controller that renders JSON back to the client:
Having this route: map.foo 'foo/*path', :controller => 'foo', :action => 'index' I have the
Can this <%= link_to 'Item', {:controller => items, :action => update, :id => @item,
I have site culture in URLs like this: routes.MapRoute( Default, {language}/{controller}/{action}/{id}, languageDefaults, languageConstraints) And
I know that, If I put this on a link , and I hit
I want to embed a link to a controller action in my page so
I have this : <table> @foreach(var foo in Model.List) { <tr> <td><a href=# class=MnuCustomerSelect

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.