gpt4 book ai didi

chalice 。无法解析名称为 'index' 的 servlet 中名称为 'grailsDispatcherServlet' 的 View

转载 作者:行者123 更新时间:2023-12-02 04:00:14 25 4
gpt4 key购买 nike

我正在开始使用 Grails (3.x) Framework,但在尝试将域内容呈现到 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-app/views/hello/index.gsp 文件存在。

关于 chalice 。无法解析名称为 'index' 的 servlet 中名称为 'grailsDispatcherServlet' 的 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30429663/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com