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
}
grails generate-views ..
to generate the views. – Gastronome