(Quick Reference)

6.4.3 Mapping to Views - Reference Documentation

Authors: Graeme Rocher, Peter Ledbrook, Marc Palmer, Jeff Brown, Luke Daley, Burt Beckwith

Version: null

6.4.3 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:

Puede resolver una URL hacia una vista sin un controlador o una accion involucrada. Por ejemplo para mapear la URL raiz / hacia un GSP en la ruta grails-app/views/index.gsp podria usar:

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

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

Alternativamente si necesita una vista que sea especifica a un controlador dado podria usar:

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