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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T03:09:22+00:00 2026-06-02T03:09:22+00:00

Question – I’ve noticed that some applications I test with have calls to another

  • 0

Question –

I’ve noticed that some applications I test with have calls to another view/controller from an action submit, but when that page is rendered, instead of seeing:

$controller/$page

I see:

$controller/index

Is this an issue with the URL mapping configuration? Default action? Just curious, because it just appears to be the URI mapping to a default instead of the actual action.

view code:

<table>
..
<g:actionSubmit class="stats" action="stats" value="View Stats"/>
..
</table

controller:

def stats() {

    def teamId = Team.get(params.id)
    def allPlayers = Player.withCriteria {
            eq('team', teamId)
            and {
                eq('isActive', true)
            }
    }
    [allPlayers:allPlayers, teamId:params.id]
}

UrlMapping:

class UrlMappings {

static mappings = {
    "/$controller/$action?/$id?"{
        constraints {
            // apply constraints here
    }
}
}

Edit

I actually figured out what it is. Which makes me even more confused.

The grails actionSubmit has an action tied to it. That form was just a normal form, without call:

<g:form>
<g:actionSubmit class="stats" action="stats" value="View Stats"/>
<g:actionSubmit class="schedule" action="schedule" value="View Schedule"/>
<g:form>

So by default, the form redirects the action to $controller/index. If you add an action call in the g:form tag, those two buttons will direct to the correct page, but the URI will now be $controller/$g:form_action.

I guess I don’t get the point of the actionSubmit’s action if the g:form is needed as a wrapper.

  • 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-06-02T03:09:24+00:00Added an answer on June 2, 2026 at 3:09 am

    Yes, index is the default action for all controllers. So if you do not specify one, that is the page you will land on for the controller.

    It is discussed in further detail on their website. Namely, the rules are:

    • If only one action is present the default URI for a controller maps to
      that action.
    • If you define an index action which is the action that
      handles requests when no action is specified in the URI /book
    • Alternatively you can set it explicitly with the defaultAction property:

      static defaultAction = “list”

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

Sidebar

Related Questions

Question 1) I have a control to which I add an attribute from the
Question: I want to test an if statement in PostgreSQL: IF (SELECT COUNT(*) FROM
Question update: I have figured out that importing JQuery (even without using it at
Question Is there a way to have a method that will always run anytime
Question I have two compilers on my hardware C++ and C89 I'm thinking about
Question slightly in the abstract... We have a situation where we have a struct
Question 1: Is is possible to throw an exception that will not be caught
Question: Is is possible, with regex, to match a word that contains the same
Have a webpage that will be viewed by mainly IE users, so CSS3 is
Question is quite simple. Let's say I have an URL config with line: url(r'^models/(?P<model_group_id>[0-9]+)/(?P<page>\d+)/$',

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.