0
如何從messages.properties中獲取域的label屬性。例如,我有一個域如下在Grails域中獲取屬性標籤
class Books{
String name
String author
String description
String rating
}
而在message.properties我已在
Books.name.label=Title
Books.author.label=Author
Books.description.label=Description
Books.rating.label=Rating
所以我可以這樣做
def fieldName = Books.name.label
,並得到「標題」以下?有沒有辦法做到這一點?