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 5931685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:43:46+00:00 2026-05-22T14:43:46+00:00

Hey. Imagine i have a something like this: class Car{ String name String color

  • 0

Hey. Imagine i have a something like this:

class Car{ 
String name
String color
String mark


}

class Motion {
String name 
Car carName
}

And i have my view (motion.gsp):

<g:each in="${motion}">

  <li>Name: ${it.name}, <br>carName: ${it.carName}, </li>
<br>
</g:each>

What i need to do is, have a link in the ‘it.carName’ field so, when i click on it, it redirects me to a new page (car.gsp) which will be almost the same as’motion.gsp’ but will show the car’s properties.

So i checked grails auto-generated gsp files ‘show’ and saw something like this:

#

<td><g:link action="show" id="${countryInstance.id}">${fieldValue(bean: countryInstance, field: "id")}</g:link></td>

#

But i dont think i understand what it does. So my questions are:

a) please explain me how the code betwen ## work.

b) if possible, give me a small hint for the code i need to update to my motion.gsp

  • 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-22T14:43:47+00:00Added an answer on May 22, 2026 at 2:43 pm

    g:link does nothing more than generate a populated <a href=''>. Check out the documentation here:

    basically, in Grails, you have Models, Views, and Controllers. The g:link tag facilitates generating links that make sense according to the Grails MVC convention. The appropriate names parameters of g:link specify which controller, and which action on that controller, to invoke in the link, as well as parameters to pass to the action.

    Just try it, its not complicated.

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

Sidebar

Related Questions

Hey. Imagine i have two separate gsp pages with diferent css formatting (with name
Hey guys, I don't know if this question has been asked yet but imagine
Hey, I'm using Levenshteins algorithm to get distance between source and target string. also
Hey all, my Computational Science course this semester is entirely in Java. I was
Hey peoples, I've been studying Java for a couple of weeks, and have decided
Hey right now I'm using jQuery and I have some global variables to hold
Hey, imagine a plain webapp with a log4j.properties which is under version control. I
Hey guys, I've got what I imagine is a simple question, but for some
Hey guys I cant manage with this code. The idea is to return default
Hey there guys, this is my first question on Stack Overflow. I figured this

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.