Align MustacheViewResolver with other similar resolvers

The `FreeMarkerViewResolver` (and other template-based resolvers) in
Spring Framework avoid using reflection if they know how to
instantiate the view class. This change aligns with them.

See gh-24011
pull/24020/head
Dave Syer 4 years ago committed by Andy Wilkinson
parent 699f03d5a6
commit 22693c17f3

@ -75,4 +75,9 @@ public class MustacheViewResolver extends AbstractTemplateViewResolver {
return view;
}
@Override
protected AbstractUrlBasedView instantiateView() {
return (getViewClass() == MustacheView.class ? new MustacheView() : super.instantiateView());
}
}

Loading…
Cancel
Save