Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grails. Could not resolve view with name 'index' in servlet with name 'grailsDispatcherServlet'

I'm getting started with Grails (3.x) Framework but I got stuck with this error while trying to render domain content to a view:

Error 500: Internal Server Error
URI /hello/index
Class javax.servlet.ServletException
Message: Could not resolve view with name 'index' in servlet with name 'grailsDispatcherServlet'

HelloController.groovy:

package helloworld   
class HelloController {

    def index() {
        def Person persona1 = new Person(firstName: "someone", lastName: "stuck", age: 21)
        [persona:persona1]
    }
}

Person.groovy:

package helloworld

class Person {
    String firstName
    String lastName
    int age
}
like image 801
Gerardo Tarragona Avatar asked May 25 '15 00:05

Gerardo Tarragona


1 Answers

Make sure that grails-app/views/hello/index.gsp file exists.

like image 100
zoran119 Avatar answered Sep 22 '22 19:09

zoran119