我刚刚创建了Intellij grails应用程序,首先打开控制台并执行:grails create-app helloworld
,cd helloworld
,然后在localhost
上启动了该应用程序,一切正常,但是随后我使用intelliJ打开了该项目并创建了一个 Controller 来打印消息“hi”并进行构建该项目。
关闭IntelliJ之后,我回到终端并尝试运行该应用程序,但它给了我这个错误:
Error 500: Internal Server Error
/ testc / index
javax.servlet.ServletException
无法在名称为'grailsDispatcherServlet'的servlet中解析名称为'/ testc / index'的 View
最佳答案
没有一些示例代码,这几乎是不可能回答的,但是生成 Controller 并不能神奇地使输出出现。您的提示位于“无法解析名称的 View ...”中,建议您仔细阅读grails文档。在这里重复所有好的信息毫无意义。
关于grails - 使用新 Controller 使内部错误严重,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38828190/