【问题标题】:get request failing while using grails-json-rest-api-plugin使用 grails-json-rest-api-plugin 时获取请求失败
【发布时间】:2015-10-14 07:13:30
【问题描述】:

类动作类型 {

static expose = 'action-type'

String name
String description

static constraints = {
    name blank: false, unique: true
}

静态映射 = { id 生成器:'increment',列:'id' } }

点击http://localhost:8090/api/v1.0/action-type

这是给出以下错误:

HTTP 代码:500

回复:{ “成功”:假, “消息”:“未找到实体空值” }

【问题讨论】:

    标签: json grails grails-plugin


    【解决方案1】:

    你试过没有 v1.0 吗?您还需要确保您的“上下文”是正确的。一般来说,如果你的应用程序被称为 'foo',那么 grails 会给你一个类似于

    的 localhost api

    http://localhost:8090/foo

    所以插件的使用方式是

    http://localhost:8090/foo/api/action-type

    (这将为您提供当前数据库中的操作类型列表)

    文档是here

    【讨论】:

    • 我在我的 Config.groovy 中定义了以下行 grails.'json-rest-api'.root = '/api/v1.0'
    猜你喜欢
    • 2015-04-03
    • 1970-01-01
    • 2018-05-21
    • 2022-11-06
    • 2016-10-02
    • 2015-06-11
    • 1970-01-01
    • 2014-03-21
    • 1970-01-01
    相关资源
    最近更新 更多