我使用Grails 2.5.1
,在我的域中限制使该字段中的最大字符50
,所以我写道:
fullName(nullable:false,maxLength:50)
但
_form
中没有任何影响<g:textField name="fullName" required="" value="${employmentSeekerInstance?.fullName}"/>
据我所知,应该将
maxLengnth=50
添加到<g:textField>
中,对吗?
最佳答案
没有maxLength
约束。正确的约束是maxSize
,然后它将maxlength
属性添加到生成的文本字段中。请参阅脚手架插件中的the relevant line。
关于grails - Grails中的maxLength问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37172892/