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

  • Home
  • SEARCH
  • 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 4272628
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T07:36:12+00:00 2026-05-21T07:36:12+00:00

The situation: Say I have an example controller called AccountController with some actions of

  • 0

The situation:

Say I have an example controller called AccountController with some actions of show, edit and update.

In the Grails URL Mappings I am trying to map by method type e.g. GET POST etc etc

Then I have a link that points to the controllers corresponding action like so:

<g:link controller="account" action="edit">Edit my account link</g:link>

with the mappings of:

"/profile"      (controller: "account", action: "show")
"/profile/edit" (controller: "account", action: [GET: "edit", POST: "update"])

the problem here is the link that is generated should be using the mappings for lookups and making it look like so “/profile/edit” in the generated html page but instead the page has “/account/edit” which according to the mappings don’t exist so just causes an error when clicked.

I have even tried the alternative syntax of:

"/profile/edit" (controller: "account") { action = [GET: "edit", POST: "update"] }

but it still points to a url mapping that does not exist.

Is this a bug or just me having a bad day?

  • 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-21T07:36:12+00:00Added an answer on May 21, 2026 at 7:36 am

    I don’t know if this (reverse URL mappings with HTTP methods) was working in previous versions of Grails, but I have reproduced your problem here in 1.3.7 and the only solution I came up with was to use named URL mappings. Using it, your tag would be:

    <g:link controller="account" action="edit" mapping="profileEditing">
        Edit my account link
    </g:link>
    

    and the edit mapping would be:

    name profileEditing: "/profile/edit" (controller: "account") {
        action = [GET: "edit", POST: "update"]
    }
    

    Regards.

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

Sidebar

Related Questions

Let's say I have a PHP Model-View-Controller framework that maps an address like http://example.com/admin/posts/edit/5
Here is the situation - let's say I have a branch on SVN called
Hypothetical situation: let's say I have a 3rd party .net assembly being used in
Let's say I have a situation in Silverlight where there is a background thread
A general architecture question in Sitecore 6... Let’s say we have a situation where
Pseudo-situation: have a class (let's say BackgroundMagic ), and it has Start() and Stop()
let me explain my current situation i have a SharePoint site lets say it
Here's the situation: Let's say I have a model A in django. When I'm
Let's say I have some code that does some floating point arithmetic and stores
Here's the situation. Let's say we have two separate object types, and we want

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.