Commit 22693c17 authored by Dave Syer's avatar Dave Syer Committed by Andy Wilkinson

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
parent 699f03d5
......@@ -75,4 +75,9 @@ public class MustacheViewResolver extends AbstractTemplateViewResolver {
return view;
}
@Override
protected AbstractUrlBasedView instantiateView() {
return (getViewClass() == MustacheView.class ? new MustacheView() : super.instantiateView());
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment