SPR-5853 - JSON formatting view for Spring MVC
This commit is contained in:
parent
398729cda1
commit
5ae919af1c
|
|
@ -136,9 +136,8 @@ public class BindingJacksonJsonView extends AbstractView {
|
||||||
*/
|
*/
|
||||||
protected Map<String, Object> filterModel(Map<String, Object> model) {
|
protected Map<String, Object> filterModel(Map<String, Object> model) {
|
||||||
Map<String, Object> result = new HashMap<String, Object>(model.size());
|
Map<String, Object> result = new HashMap<String, Object>(model.size());
|
||||||
if (CollectionUtils.isEmpty(renderedAttributes)) {
|
Set<String> renderedAttributes =
|
||||||
renderedAttributes = model.keySet();
|
!CollectionUtils.isEmpty(this.renderedAttributes) ? this.renderedAttributes : model.keySet();
|
||||||
}
|
|
||||||
for (Map.Entry<String, Object> entry : model.entrySet()) {
|
for (Map.Entry<String, Object> entry : model.entrySet()) {
|
||||||
if (!(entry instanceof BindingResult) && renderedAttributes.contains(entry.getKey())) {
|
if (!(entry instanceof BindingResult) && renderedAttributes.contains(entry.getKey())) {
|
||||||
result.put(entry.getKey(), entry.getValue());
|
result.put(entry.getKey(), entry.getValue());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue