gpt4 book ai didi

Grails 自动重新加载新的 Controller Action

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

我有

  • 创建了新的 Grails 2.4.3 项目
  • 已创建 TestController
  • 套装grails.reload.enabled = trueBuildConfig.groovy
  • 使用 grails -reloading run-app 运行应用程序

  • 我的 Controller 操作代码:
    def index() {
    render "test"
    }

    当我更改字符串时 testtest2 - 我在控制台中看到(在 Eclipse 中):
    ..................
    |Compiling 1 source files

    重新加载页面后,我看到 test2 - 好的。

    但是当我尝试添加新方法时:
    def test3() {
    render "test3"
    }

    我懂了:

    error result

    为什么? 为什么连网址都没有?

    示例 - 操作不存在:
    enter image description here

    有趣的是 - 当我创建一个全新的 Controller 时 index新创建的 Controller 的 Action 有效......

    编辑

    一段时间后,我决定使用 spring-boot,事实上 - 它也不起作用。我认为 springloaded 是这里的问题,因为它没有在 @Controller 中添加新方法

    最佳答案

    我在 github repo 上问过同样的问题.

    似乎最新的 Spring 式 SNAPSHOT 是 工作正常 .

    但它必须集成到 Grails 中——不幸的是,可能在下一个版本中:(

    关于Grails 自动重新加载新的 Controller Action ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25443800/

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