Browse Source

Merge pull request #32030 from mdeinum

* pr/32030:
  Remove use of reflection in MustacheViewResolver

Closes gh-32030
pull/32112/head
Stephane Nicoll 4 years ago
parent
commit
f58012395c
  1. 8
      spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/result/view/MustacheViewResolver.java

8
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/result/view/MustacheViewResolver.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -27,6 +27,7 @@ import org.springframework.web.reactive.result.view.ViewResolver; @@ -27,6 +27,7 @@ import org.springframework.web.reactive.result.view.ViewResolver;
* Spring WebFlux {@link ViewResolver} for Mustache.
*
* @author Brian Clozel
* @author Marten Deinum
* @since 2.0.0
*/
public class MustacheViewResolver extends UrlBasedViewResolver {
@ -75,4 +76,9 @@ public class MustacheViewResolver extends UrlBasedViewResolver { @@ -75,4 +76,9 @@ public class MustacheViewResolver extends UrlBasedViewResolver {
return view;
}
@Override
protected AbstractUrlBasedView instantiateView() {
return (getViewClass() == MustacheView.class) ? new MustacheView() : super.instantiateView();
}
}

Loading…
Cancel
Save