aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/launcher
diff options
context:
space:
mode:
authorDenis Anisimov <denis@vaadin.com>2014-11-04 13:09:03 +0200
committerDenis Anisimov <denis@vaadin.com>2015-01-10 14:31:57 +0200
commitacffa172b9027cc151cf752867eadabfe896c805 (patch)
treea7eab1fa60faca934ecdfd4410064bbe24f233e0 /uitest/src/com/vaadin/launcher
parent3a65f9869e2e9eccae4b28f0640920f7265cb035 (diff)
downloadvaadin-framework-acffa172b9027cc151cf752867eadabfe896c805.tar.gz
vaadin-framework-acffa172b9027cc151cf752867eadabfe896c805.zip
Wrap null values into JsonNull json objects in bootstrap handler(#14594)
Change-Id: I1e03bfd1b4eff77e920208892f030582ff877d78
Diffstat (limited to 'uitest/src/com/vaadin/launcher')
-rw-r--r--uitest/src/com/vaadin/launcher/ApplicationRunnerServlet.java34
1 files changed, 34 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/launcher/ApplicationRunnerServlet.java b/uitest/src/com/vaadin/launcher/ApplicationRunnerServlet.java
index 1cbb1aa039..e2b93ab7d2 100644
--- a/uitest/src/com/vaadin/launcher/ApplicationRunnerServlet.java
+++ b/uitest/src/com/vaadin/launcher/ApplicationRunnerServlet.java
@@ -46,6 +46,9 @@ import com.vaadin.server.LegacyVaadinServlet;
import com.vaadin.server.ServiceException;
import com.vaadin.server.SessionInitEvent;
import com.vaadin.server.SessionInitListener;
+import com.vaadin.server.SystemMessages;
+import com.vaadin.server.SystemMessagesInfo;
+import com.vaadin.server.SystemMessagesProvider;
import com.vaadin.server.UIClassSelectionEvent;
import com.vaadin.server.UIProvider;
import com.vaadin.server.VaadinRequest;
@@ -61,6 +64,9 @@ import com.vaadin.util.CurrentInstance;
@SuppressWarnings("serial")
public class ApplicationRunnerServlet extends LegacyVaadinServlet {
+ public static String CUSTOM_SYSTEM_MESSAGES_PROPERTY = "custom-"
+ + SystemMessages.class.getName();
+
/**
* The name of the application class currently used. Only valid within one
* request.
@@ -339,6 +345,34 @@ public class ApplicationRunnerServlet extends LegacyVaadinServlet {
new ProxyDeploymentConfiguration(originalConfiguration));
}
+ @Override
+ protected VaadinServletService createServletService(
+ DeploymentConfiguration deploymentConfiguration)
+ throws ServiceException {
+ VaadinServletService service = super
+ .createServletService(deploymentConfiguration);
+ final SystemMessagesProvider provider = service
+ .getSystemMessagesProvider();
+ service.setSystemMessagesProvider(new SystemMessagesProvider() {
+
+ @Override
+ public SystemMessages getSystemMessages(
+ SystemMessagesInfo systemMessagesInfo) {
+ if (systemMessagesInfo.getRequest() == null) {
+ return provider.getSystemMessages(systemMessagesInfo);
+ }
+ Object messages = systemMessagesInfo.getRequest().getAttribute(
+ CUSTOM_SYSTEM_MESSAGES_PROPERTY);
+ if (messages instanceof SystemMessages) {
+ return (SystemMessages) messages;
+ }
+ return provider.getSystemMessages(systemMessagesInfo);
+ }
+
+ });
+ return service;
+ }
+
private static DeploymentConfiguration findDeploymentConfiguration(
DeploymentConfiguration originalConfiguration) throws Exception {
// First level of cache