8.3.5 Mapping to Views

You can resolve a URL to a view without a controller or action involved. For example to map the root URL / to a GSP at the location grails-app/views/index.gsp you could use:

  1. static mappings = {
  2. "/"(view: "/index") // map the root URL
  3. }

Alternatively if you need a view that is specific to a given controller you could use:

  1. static mappings = {
  2. "/help"(controller: "site", view: "help") // to a view for a controller
  3. }