diff options
author | Leif Åstrand <leif@vaadin.com> | 2011-11-22 17:37:08 +0200 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2011-11-22 17:37:08 +0200 |
commit | 3bbb808f7f5d9a0b7cdf5454fd3b5843c5b78fe4 (patch) | |
tree | 85ee7d242f4967cbdbca7f36be0951e70869a187 /src/com | |
parent | 6b655c4a63cda2100f08c78b36c347934bb38492 (diff) | |
download | vaadin-framework-3bbb808f7f5d9a0b7cdf5454fd3b5843c5b78fe4.tar.gz vaadin-framework-3bbb808f7f5d9a0b7cdf5454fd3b5843c5b78fe4.zip |
Remove old Debug param and make productionMode available in Application
Diffstat (limited to 'src/com')
4 files changed, 19 insertions, 20 deletions
diff --git a/src/com/vaadin/Application.java b/src/com/vaadin/Application.java index 5a1dac3618..3a828636a0 100644 --- a/src/com/vaadin/Application.java +++ b/src/com/vaadin/Application.java @@ -281,6 +281,8 @@ public class Application implements Terminal.ErrorListener, Serializable { private int nextRootId = 0; private Map<Integer, Root> roots = new HashMap<Integer, Root>(); + private boolean productionMode = true; + /** * Gets the user of the application. * @@ -392,11 +394,13 @@ public class Application implements Terminal.ErrorListener, Serializable { * configuration. * @param context * the context application will be running in. + * @param productionMode * */ public void start(URL applicationUrl, Properties applicationProperties, - ApplicationContext context) { + ApplicationContext context, boolean productionMode) { this.applicationUrl = applicationUrl; + this.productionMode = productionMode; properties = applicationProperties; this.context = context; init(); @@ -1660,4 +1664,8 @@ public class Application implements Terminal.ErrorListener, Serializable { public Root getRootById(int rootId) { return roots.get(Integer.valueOf(rootId)); } + + public boolean isProductionMode() { + return productionMode; + } } diff --git a/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java b/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java index c96077d30b..94c3e3e3e4 100644 --- a/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java +++ b/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java @@ -175,15 +175,11 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet } private void checkProductionMode() { + // TODO Identical code in AbstractApplicationServlet -> refactor // Check if the application is in production mode. - // We are in production mode if Debug=false or productionMode=true - if (getApplicationOrSystemProperty(SERVLET_PARAMETER_DEBUG, "true") - .equals("false")) { - // "Debug=true" is the old way and should no longer be used - productionMode = true; - } else if (getApplicationOrSystemProperty( - SERVLET_PARAMETER_PRODUCTION_MODE, "false").equals("true")) { - // "productionMode=true" is the real way to do it + // We are in production mode if productionMode=true + if (getApplicationOrSystemProperty(SERVLET_PARAMETER_PRODUCTION_MODE, + "false").equals("true")) { productionMode = true; } @@ -703,7 +699,8 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet Locale locale = request.getLocale(); application.setLocale(locale); // No application URL when running inside a portlet - application.start(null, applicationProperties, context); + application.start(null, applicationProperties, context, + isProductionMode()); } } diff --git a/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java b/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java index 9072e67600..0593764c52 100644 --- a/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java +++ b/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java @@ -217,14 +217,9 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements private void checkProductionMode() { // Check if the application is in production mode. - // We are in production mode if Debug=false or productionMode=true - if (getApplicationOrSystemProperty(SERVLET_PARAMETER_DEBUG, "true") - .equals("false")) { - // "Debug=true" is the old way and should no longer be used - productionMode = true; - } else if (getApplicationOrSystemProperty( - SERVLET_PARAMETER_PRODUCTION_MODE, "false").equals("true")) { - // "productionMode=true" is the real way to do it + // We are in production mode if productionMode=true + if (getApplicationOrSystemProperty(SERVLET_PARAMETER_PRODUCTION_MODE, + "false").equals("true")) { productionMode = true; } @@ -1029,7 +1024,7 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements Locale locale = request.getLocale(); application.setLocale(locale); application.start(applicationUrl, applicationProperties, - webApplicationContext); + webApplicationContext, isProductionMode()); } } diff --git a/src/com/vaadin/terminal/gwt/server/Constants.java b/src/com/vaadin/terminal/gwt/server/Constants.java index d60d723e24..e3d7dfa8e2 100644 --- a/src/com/vaadin/terminal/gwt/server/Constants.java +++ b/src/com/vaadin/terminal/gwt/server/Constants.java @@ -43,7 +43,6 @@ public interface Constants { static final String URL_PARAMETER_REPAINT_ALL = "repaintAll"; static final String URL_PARAMETER_THEME = "theme"; - static final String SERVLET_PARAMETER_DEBUG = "Debug"; static final String SERVLET_PARAMETER_PRODUCTION_MODE = "productionMode"; static final String SERVLET_PARAMETER_DISABLE_XSRF_PROTECTION = "disable-xsrf-protection"; static final String SERVLET_PARAMETER_RESOURCE_CACHE_TIME = "resourceCacheTime"; |