I'm recently trying to build an small webapp to enable AJAX call my controller and return the JSON result. I understand the annotation
@JsonView(Views.Public.class)
serves as a filter to exclude all fields that you don't want them to be serialized. Basically, all fields that don't annotated with this JsonView will be excluded.
So my question is: in a Spring controller, is annotating JsonView necessary? What if you don't include them at all, neither in your controller nor in your model object?
Any link/article will be greatly appreciated. Thank you!