Fabiano Moura
Fabiano Moura

Reputation: 79

How to change the home page in grails?

I'm using the plugin on my project "spring-security-core: 2.0-RC2". Through the "s2-quickstart" command I created the USER and ROLE domains. When running the project, it created the screen, where I can test the login. How do I get this screen is the first to be called?

PS: I don't created the controller and view because the plugin does this automatically creates.

Thank you

Upvotes: 1

Views: 59

Answers (1)

Dónal
Dónal

Reputation: 187399

The home page is whatever "/" is mapped to in UrlMappings.groovy. If the login screen is rendered by the login action of UserController, set the following in UrlMappings.groovy

"/"(controller: "user", action: "login")

Alternatively, if the GSP that creates the login screen can be rendered directly (i.e. does not require a model), set the following in UrlMappings.groovy

"/"(view: "/login")

The above assumed that the login screen's GSP is at /grails-app/views/login.gsp

Upvotes: 2

Related Questions