Alex Rivera | Logout

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

Asked 2008-08-26T12:10:00.830
37

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.

Edit
Report

2 Answers

13

Edit UrlMappings.groovy

Add for example add this rule, to handle the root with a HomeController.

"/"(controller:'home')

answered 2008-09-15T09:57:39.330
2

Simple and Neat

  1. Go to File: grails-app/conf/UrlMappings.groovy.

  2. Replace the line : "/"(view:"/index") with "/"(controller:'home', action:"/index").

Home is Your Controller to Run(Like in spring security you can use 'login' ) and action is the grails view page associated with your controller(In Spring Security '/auth').

Add redirection of pages as per your application needs.

answered 2011-12-20T19:33:12.493

Your Answer