我有一个表单,想要添加客户URL参数,例如在经典的“创建”中
http://localhost:8080/test/customer/create?abc=asd
我在 View 文件中将表单从POST更改为GET
method =“GET”并在 Controller 中,删除allowedMethods
仍未将自定义参数“abc”从 View 插入到操作中,它没有出现在params中-params.abc为null
表演 Action 有效
http://localhost:8080/grails/copyOfLead/show/3?abc=asd
作品....
最佳答案
如果我理解的正确,那么您必须在表单中添加隐藏字段
<g:hiddenField name="abc" value="${params.abc}" />
关于grails - 将网址参数添加到grails表单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18400352/