From 001e0fcc05c6e7678b5cf5efc891fd0c2c720496 Mon Sep 17 00:00:00 2001 From: Fabian Lange Date: Wed, 9 Jul 2014 16:23:43 +0200 Subject: [PATCH] Fix overwrite mechanism for web.xml atmosphere init params (#14196). Non obvious problem before. "config" is a property of AtmosphereFramework which also has getInitParameter(String) method. So it compiles but does not do what is intended: to check against the user defined web.xml servlet init-prams. (the variableName servletConfig has the same problem :-)) Change-Id: Ib02f0b94312327d482775456c2d63a904b1e8104 --- .../server/communication/PushRequestHandler.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/server/src/com/vaadin/server/communication/PushRequestHandler.java b/server/src/com/vaadin/server/communication/PushRequestHandler.java index db14e73c1a..308f94686f 100644 --- a/server/src/com/vaadin/server/communication/PushRequestHandler.java +++ b/server/src/com/vaadin/server/communication/PushRequestHandler.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -47,7 +47,7 @@ import com.vaadin.shared.communication.PushConstants; * Handles requests to open a push (bidirectional) communication channel between * the client and the server. After the initial request, communication through * the push channel is managed by {@link PushHandler}. - * + * * @author Vaadin Ltd * @since 7.1 */ @@ -66,7 +66,8 @@ public class PushRequestHandler implements RequestHandler, public PushRequestHandler(VaadinServletService service) throws ServiceException { - final ServletConfig config = service.getServlet().getServletConfig(); + final ServletConfig vaadinServletConfig = service.getServlet() + .getServletConfig(); atmosphere = new AtmosphereFramework() { @Override @@ -77,7 +78,7 @@ public class PushRequestHandler implements RequestHandler, @Override public AtmosphereFramework addInitParameter(String name, String value) { - if (config.getInitParameter(name) == null) { + if (vaadinServletConfig.getInitParameter(name) == null) { super.addInitParameter(name, value); } return this; @@ -117,7 +118,7 @@ public class PushRequestHandler implements RequestHandler, "org.atmosphere.cpr.showSupportMessage", "false"); try { - atmosphere.init(config); + atmosphere.init(vaadinServletConfig); // Ensure the client-side knows how to split the message stream // into individual messages when using certain transports -- 2.39.5