diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/script/ScriptTemplateConfigurer.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/script/ScriptTemplateConfigurer.java index efff09f64f4..e9714b48364 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/script/ScriptTemplateConfigurer.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/script/ScriptTemplateConfigurer.java @@ -26,10 +26,8 @@ import javax.script.ScriptEngine; *
*
* // Add the following to an @Configuration class
- *
* @Bean
* public ScriptTemplateConfigurer mustacheConfigurer() {
- *
* ScriptTemplateConfigurer configurer = new ScriptTemplateConfigurer();
* configurer.setEngineName("nashorn");
* configurer.setScripts("mustache.js");
@@ -39,9 +37,9 @@ import javax.script.ScriptEngine;
* }
*
*
- * NOTE: It is possible to use non thread-safe script engines and - * templating libraries, like Handlebars or React running on Nashorn, by setting - * the {@link #setSharedEngine sharedEngine} property to {@code false}. + *
NOTE: It is possible to use non thread-safe script engines with + * templating libraries not designed for concurrency, like Handlebars or React running on + * Nashorn, by setting the {@link #setSharedEngine sharedEngine} property to {@code false}. * * @author Sebastien Deleuze * @since 4.2 @@ -102,8 +100,10 @@ public class ScriptTemplateConfigurer implements ScriptTemplateConfig { /** * When set to {@code false}, use thread-local {@link ScriptEngine} instances instead * of one single shared instance. This flag should be set to {@code false} for those - * using non thread-safe script engines and templating libraries, like Handlebars or - * React running on Nashorn for example. + * using non thread-safe script engines with templating libraries not designed for + * concurrency, like Handlebars or React running on Nashorn for example. + * In this case, Java 8u60 or greater is required due to + * this bug. *
When this flag is set to {@code false}, the script engine must be specified using
* {@link #setEngineName(String)}. Using {@link #setEngine(ScriptEngine)} is not
* possible because multiple instances of the script engine need to be created lazily
diff --git a/spring-webmvc/src/main/resources/org/springframework/web/servlet/config/spring-mvc-4.2.xsd b/spring-webmvc/src/main/resources/org/springframework/web/servlet/config/spring-mvc-4.2.xsd
index 554092bea86..a424c3da9e9 100644
--- a/spring-webmvc/src/main/resources/org/springframework/web/servlet/config/spring-mvc-4.2.xsd
+++ b/spring-webmvc/src/main/resources/org/springframework/web/servlet/config/spring-mvc-4.2.xsd
@@ -1265,7 +1265,9 @@