You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
YogaSpringView randomly selects the first available model attribute although it might not be the intended one.
Steps to reproduce:
Create method in controller with the following signature:
@RequestMapping(method = RequestMethod.GET)
public List<Entity> list(@Valid ParamsDTO params) {
The model passed to the view will now contain at least the attribute for the bound ParamsDTO object, a BindingResult object and an attribute for the returned value in that order. In this case the ParamsDTO object will be rendered.
a) provide an annotation and have the view scan the model for objects with that annotaton? (But then what about collections? maybe pre-register entities for serialization via annotations or spring config and select the collection if its generic type is in the list of registered types?)
b) provide a filter that will scan the model for key patterns i.e. entity*. This could work because Spring has a mechanism to create names for model attributes, for example when the attribute is a list it will name it "[generic type of the list]List" i.e.: customerList.
The text was updated successfully, but these errors were encountered:
YogaSpringView randomly selects the first available model attribute although it might not be the intended one.
Steps to reproduce:
Relevant source code:
YogaSpringView.java:32
Solutions (?)
Just out of the top of my head:
a) provide an annotation and have the view scan the model for objects with that annotaton? (But then what about collections? maybe pre-register entities for serialization via annotations or spring config and select the collection if its generic type is in the list of registered types?)
b) provide a filter that will scan the model for key patterns i.e. entity*. This could work because Spring has a mechanism to create names for model attributes, for example when the attribute is a list it will name it "[generic type of the list]List" i.e.: customerList.
The text was updated successfully, but these errors were encountered: