How do you change the default homepage in a Grails application?

Ed.T picture Ed.T · Aug 26, 2008 · Viewed 29.1k times · Source

What is the configuration setting for modifying the default homepage in a Grails application to no longer be appName/index.gsp? Of course you can set that page to be a redirect but there must be a better way.

Answer

Bob Herrmann picture Bob Herrmann · Sep 15, 2008

Add this in UrlMappings.groovy

 "/" {
    controller = "yourController"
    action = "yourAction"
 }

By configuring the URLMappings this way, the home-page of the app will be yourWebApp/yourController/yourAction.

(cut/pasted from IntelliGrape Blog)