-
Notifications
You must be signed in to change notification settings - Fork 950
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Grails Controller Web Binding does not work with Serializable or Generic Binding Objects #13634
Comments
There is already a For example: @BindUsing(domain = Sample) |
@matrei |
Aha, I see.
I don't doubt it.
|
@matrei actually this could be used for any sort of controller inheritance and is not specific to scaffolding. It also provides a mechanism to squash warnings from ControllerActionTransformer.java. The main point behind this is to further eliminate the need to repeat common code functionality across controllers. This tag would only be used by This is what RestfulContoller does. |
Ok, good info! The Lines 760 to 766 in 8871703
|
That is 1 case. It will forcefully ignore binding with the annotation and also would suppress warning messages like you see there. |
The following (understandably) does not work, but a mechanism should be provided to facilitate binding
ControllerActionTransformer.java
accepts a parameter of type [java.io.Serializable]. Interface types and abstract class types are not supported as command objects. This parameter will be ignored.
grails-core/grails-plugin-controllers/src/main/groovy/org/grails/compiler/web/ControllerActionTransformer.java
Lines 844 to 856 in 8871703
grails-core/grails-plugin-controllers/src/main/groovy/grails/artefact/Controller.groovy
Lines 363 to 460 in 9ea9c60
Solution Proposal -
@Bind
annotationadditionally the following will work the same and allow generic and serializable binding
@Bind should
skip=true
allow suppression of controller warning messages.For instance annotation
@Scaffold
annotation definition with@Bind
will allow@Scaffold(domain=Sample)
to also function as@Bind
and only require 1 attribute.The text was updated successfully, but these errors were encountered: