gpt4 book ai didi

grails - Grails 2.5.3无法解析 Controller 上的消息参数

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

我有一个用作REST API的 Controller ,并且某些操作返回的错误消息是I18N并具有参数。我面临的问题是参数没有得到解决,也不知道为什么。

这是我正在做的一个例子:

message(code:'query.execute.error.organizationDoesntExists', args:[organizationUid])

在输出上,只是 query.execute.error.organizationDoesntExists。该代码在I18N属性文件中定义。

另外,Grails错误似乎无法解决这些参数,例如保存一个域实例,该域实例在几个字段上都有错误,因为没有提供数据:
Property [{0}] of class [{1}] cannot be null
Property [{0}] of class [{1}] cannot be null
Property [{0}] of class [{1}] cannot be null
Property [{0}] of class [{1}] cannot be null

有任何想法吗?

最佳答案

可能query.execute.error.organizationDoesntExists不在编译的messages.properties中。清理并重建您的项目。

关于grails - Grails 2.5.3无法解析 Controller 上的消息参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35820104/

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