【问题标题】:Grails 3.3.1 console giving 404Grails 3.3.1 控制台给出 404
【发布时间】:2017-12-19 11:15:46
【问题描述】:

我有一个使用角度配置文件的 grails 应用程序,控制台安装在我的 build.gradle 中

console "org.grails:grails-console"

我正在开发模式下运行应用程序:

Grails application running at http://localhost:8080 in environment: development

转到http://localhost:8080/consolehttp://localhost:8080/static/console 时,控制台不显示。使用 Chrome 控制台,我看到发生 404 错误:

Request URL:http://localhost:8080/static/console
Request Method:GET
Status Code:404 
Remote Address:[::1]:8080
Referrer Policy:no-referrer-when-downgrade

我没有可能干扰控制台的自定义拦截器,也没有使用 spring security 或其他安全框架。

如何让 Grails 控制台在我的项目中运行?

【问题讨论】:

    标签: grails grails-plugin


    【解决方案1】:

    要使用基于 Web 的控制台,您需要添加插件:

    compile 'org.grails.plugins:grails-console:2.1.1'
    

    grails-console GitHub sources and docs

    你的依赖:

    console "org.grails:grails-console"
    

    适用于在“grails 控制台”命令之后运行的基于 Swing 的控制台

    【讨论】:

    • 嘿@Evgeny,感谢您的回答。我已经安装了正确的插件,但现在尝试访问控制台时出现错误:'没有方法签名:org.grails.plugins.console.ConsoleController.createLink()' 我尝试禁用 crsf 保护并安装 grails-plugin -gsp,没有成功。你知道缺少什么吗?
    • grails > 3.3.0 你需要“org.grails.plugins:gsp:3.3.0”而不是“grails-plugin-gsp”
    • 试过了,但并没有解决我的问题,我仍然在处理请求时出现'MissingMethodException:[GET] /consoleNo signature of method: org.grails.plugins.console.ConsoleController.createLink () 适用于参数类型:(java.util.LinkedHashMap) 值:[[action:index, absolute:true]]。'
    • 显示完整的 build.gradle
    猜你喜欢
    • 1970-01-01
    • 2011-01-14
    • 2018-01-02
    • 1970-01-01
    • 1970-01-01
    • 2017-06-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多