diff --git a/flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java b/flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java index e49b2b3b936..3085a8c0879 100644 --- a/flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java +++ b/flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java @@ -16,9 +16,8 @@ package com.vaadin.flow.server; -import javax.servlet.Servlet; -import javax.servlet.ServletContext; -import javax.servlet.http.HttpServletResponse; +import static java.nio.charset.StandardCharsets.UTF_8; + import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStream; @@ -47,6 +46,10 @@ import java.util.stream.Collectors; import java.util.stream.StreamSupport; +import javax.servlet.Servlet; +import javax.servlet.ServletContext; +import javax.servlet.http.HttpServletResponse; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -60,7 +63,6 @@ import com.vaadin.flow.router.Router; import com.vaadin.flow.server.ServletHelper.RequestType; import com.vaadin.flow.server.communication.AtmospherePushConnection; -import com.vaadin.flow.server.communication.FaviconHandler; import com.vaadin.flow.server.communication.HeartbeatHandler; import com.vaadin.flow.server.communication.PwaHandler; import com.vaadin.flow.server.communication.SessionRequestHandler; @@ -77,7 +79,6 @@ import elemental.json.JsonException; import elemental.json.JsonObject; import elemental.json.impl.JsonUtil; -import static java.nio.charset.StandardCharsets.UTF_8; /** * An abstraction of the underlying technology, e.g. servlets, for handling @@ -294,7 +295,6 @@ public void init() throws ServiceException { protected List createRequestHandlers() throws ServiceException { List handlers = new ArrayList<>(); - handlers.add(new FaviconHandler()); handlers.add(new SessionRequestHandler()); handlers.add(new HeartbeatHandler()); handlers.add(new UidlRequestHandler()); @@ -1322,8 +1322,7 @@ private int getHeartbeatTimeout() { */ private int getUidlRequestTimeout(VaadinSession session) { return getDeploymentConfiguration().isCloseIdleSessions() - ? session.getSession().getMaxInactiveInterval() - : -1; + ? session.getSession().getMaxInactiveInterval() : -1; } /** diff --git a/flow-server/src/main/java/com/vaadin/flow/server/VaadinServletService.java b/flow-server/src/main/java/com/vaadin/flow/server/VaadinServletService.java index 1664c9180e1..962773136f5 100644 --- a/flow-server/src/main/java/com/vaadin/flow/server/VaadinServletService.java +++ b/flow-server/src/main/java/com/vaadin/flow/server/VaadinServletService.java @@ -16,9 +16,6 @@ package com.vaadin.flow.server; -import javax.servlet.GenericServlet; -import javax.servlet.ServletContext; -import javax.servlet.http.HttpServletRequest; import java.io.InputStream; import java.net.MalformedURLException; import java.net.URL; @@ -26,10 +23,15 @@ import java.util.Objects; import java.util.Optional; +import javax.servlet.GenericServlet; +import javax.servlet.ServletContext; +import javax.servlet.http.HttpServletRequest; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.vaadin.flow.function.DeploymentConfiguration; +import com.vaadin.flow.server.communication.FaviconHandler; import com.vaadin.flow.server.communication.PushRequestHandler; import com.vaadin.flow.server.startup.RouteRegistry; import com.vaadin.flow.shared.ApplicationConstants; @@ -77,6 +79,7 @@ protected VaadinServletService() { protected List createRequestHandlers() throws ServiceException { List handlers = super.createRequestHandlers(); + handlers.add(0, new FaviconHandler()); handlers.add(0, new BootstrapHandler()); if (isAtmosphereAvailable()) { try {