diff --git a/spring-boot/src/main/java/org/springframework/boot/context/embedded/AbstractEmbeddedServletContainerFactory.java b/spring-boot/src/main/java/org/springframework/boot/context/embedded/AbstractEmbeddedServletContainerFactory.java
index 99612cb8a9..f2dfc8f15f 100644
--- a/spring-boot/src/main/java/org/springframework/boot/context/embedded/AbstractEmbeddedServletContainerFactory.java
+++ b/spring-boot/src/main/java/org/springframework/boot/context/embedded/AbstractEmbeddedServletContainerFactory.java
@@ -217,7 +217,7 @@ public abstract class AbstractEmbeddedServletContainerFactory implements
@Override
public void addErrorPages(ErrorPage... errorPages) {
- Assert.notNull(this.initializers, "ErrorPages must not be null");
+ Assert.notNull(errorPages, "ErrorPages must not be null");
this.errorPages.addAll(Arrays.asList(errorPages));
}
diff --git a/spring-boot/src/main/java/org/springframework/boot/context/embedded/EmbeddedWebApplicationContext.java b/spring-boot/src/main/java/org/springframework/boot/context/embedded/EmbeddedWebApplicationContext.java
index a0dcfa4ccb..f4a871f091 100644
--- a/spring-boot/src/main/java/org/springframework/boot/context/embedded/EmbeddedWebApplicationContext.java
+++ b/spring-boot/src/main/java/org/springframework/boot/context/embedded/EmbeddedWebApplicationContext.java
@@ -20,7 +20,6 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
-import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map.Entry;
@@ -64,9 +63,10 @@ import org.springframework.web.context.support.WebApplicationContextUtils;
*
* In addition, any {@link Servlet} or {@link Filter} beans defined in the context will be
* automatically registered with the embedded Servlet container. In the case of a single
- * Servlet bean, the '/*' mapping will be used. If multiple Servlet beans are found then
- * the lowercase bean name will be used as a mapping prefix. Filter beans will be mapped
- * to all URLs ('/*').
+ * Servlet bean, the '/' mapping will be used. If multiple Servlet beans are found then
+ * the lowercase bean name will be used as a mapping prefix. Any Servlet named
+ * 'dispatcherServlet' will always be mapped to '/'. Filter beans will be mapped to all
+ * URLs ('/*').
*
*
* For more advanced configuration, the context can instead define beans that implement
@@ -205,43 +205,47 @@ public class EmbeddedWebApplicationContext extends GenericWebApplicationContext
protected Collection getServletContextInitializerBeans() {
Set initializers = new LinkedHashSet();
- Set