You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Constants.java 8.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. /*
  2. * Copyright 2000-2018 Vaadin Ltd.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  5. * use this file except in compliance with the License. You may obtain a copy of
  6. * the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. * License for the specific language governing permissions and limitations under
  14. * the License.
  15. */
  16. package com.vaadin.server;
  17. import com.vaadin.shared.communication.PushMode;
  18. import com.vaadin.ui.declarative.DesignContext;
  19. /**
  20. * Internal constants used by both the client and the server side framework.
  21. *
  22. * @since 6.2
  23. *
  24. */
  25. public interface Constants {
  26. static final String NOT_PRODUCTION_MODE_INFO = "\n"
  27. + "=================================================================\n"
  28. + "Vaadin is running in DEBUG MODE.\nAdd productionMode=true to web.xml "
  29. + "to disable debug features.\nTo show debug window, add ?debug to "
  30. + "your application URL.\n"
  31. + "=================================================================";
  32. static final String WARNING_XSRF_PROTECTION_DISABLED = "\n"
  33. + "===========================================================\n"
  34. + "WARNING: Cross-site request forgery protection is disabled!\n"
  35. + "===========================================================";
  36. static final String WARNING_RESOURCE_CACHING_TIME_NOT_NUMERIC = "\n"
  37. + "===========================================================\n"
  38. + "WARNING: resourceCacheTime has been set to a non integer value "
  39. + "in web.xml. The default of 1h will be used.\n"
  40. + "===========================================================";
  41. static final String WARNING_HEARTBEAT_INTERVAL_NOT_NUMERIC = "\n"
  42. + "===========================================================\n"
  43. + "WARNING: heartbeatInterval has been set to a non integer value "
  44. + "in web.xml. The default of 5min will be used.\n"
  45. + "===========================================================";
  46. static final String WARNING_PUSH_MODE_NOT_RECOGNIZED = "\n"
  47. + "===========================================================\n"
  48. + "WARNING: pushMode has been set to an unrecognized value\n"
  49. + "in web.xml. The permitted values are \"disabled\", \"manual\",\n"
  50. + "and \"automatic\". The default of \"disabled\" will be used.\n"
  51. + "===========================================================";
  52. static final String WIDGETSET_MISMATCH_INFO = "\n"
  53. + "=================================================================\n"
  54. + "The widgetset in use does not seem to be built for the Vaadin\n"
  55. + "version in use. This might cause strange problems - a\n"
  56. + "recompile/deploy is strongly recommended.\n"
  57. + " Vaadin version: %s\n" + " Widgetset version: %s\n"
  58. + "=================================================================";
  59. // Keep the version number in sync with pom.xml
  60. static final String REQUIRED_ATMOSPHERE_RUNTIME_VERSION = "2.4.30.vaadin2";
  61. static final String INVALID_ATMOSPHERE_VERSION_WARNING = "\n"
  62. + "=================================================================\n"
  63. + "Vaadin depends on Atmosphere {0} but version {1} was found.\n"
  64. + "This might cause compatibility problems if push is used.\n"
  65. + "=================================================================";
  66. static final String ATMOSPHERE_MISSING_ERROR = "\n"
  67. + "=================================================================\n"
  68. + "Atmosphere could not be loaded. When using push with Vaadin, the\n"
  69. + "Atmosphere framework must be present on the classpath.\n"
  70. + "If using a dependency management system, please add a dependency\n"
  71. + "to vaadin-push.\n"
  72. + "If managing dependencies manually, please make sure Atmosphere\n"
  73. + REQUIRED_ATMOSPHERE_RUNTIME_VERSION
  74. + " is included on the classpath.\n" + "Will fall back to using "
  75. + PushMode.class.getSimpleName() + "." + PushMode.DISABLED.name()
  76. + ".\n"
  77. + "=================================================================";
  78. static final String PUSH_NOT_SUPPORTED_ERROR = "\n"
  79. + "=================================================================\n"
  80. + "Push is not supported for {0}\n" + "Will fall back to using "
  81. + PushMode.class.getSimpleName() + "." + PushMode.DISABLED.name()
  82. + ".\n"
  83. + "=================================================================";
  84. static final String CANNOT_ACQUIRE_CLASSLOADER_SEVERE = "\n"
  85. + "=================================================================\n"
  86. + "Vaadin was unable to acquire class loader from servlet container\n"
  87. + "to load your application classes. Setup appropriate security\n"
  88. + "policy to allow invoking Thread.getContextClassLoader() from\n"
  89. + "VaadinService if you're not using custom class loader.\n"
  90. + "NullPointerExceptions will be thrown later."
  91. + "=================================================================";
  92. static final String URL_PARAMETER_THEME = "theme";
  93. static final String SERVLET_PARAMETER_PRODUCTION_MODE = "productionMode";
  94. // Javadocs for VaadinService should be updated if this value is changed
  95. static final String SERVLET_PARAMETER_DISABLE_XSRF_PROTECTION = "disable-xsrf-protection";
  96. static final String SERVLET_PARAMETER_RESOURCE_CACHE_TIME = "resourceCacheTime";
  97. static final String SERVLET_PARAMETER_HEARTBEAT_INTERVAL = "heartbeatInterval";
  98. static final String SERVLET_PARAMETER_CLOSE_IDLE_SESSIONS = "closeIdleSessions";
  99. static final String SERVLET_PARAMETER_PUSH_MODE = "pushMode";
  100. static final String SERVLET_PARAMETER_UI_PROVIDER = "UIProvider";
  101. static final String SERVLET_PARAMETER_SYNC_ID_CHECK = "syncIdCheck";
  102. static final String SERVLET_PARAMETER_SENDURLSASPARAMETERS = "sendUrlsAsParameters";
  103. static final String SERVLET_PARAMETER_PUSH_SUSPEND_TIMEOUT_LONGPOLLING = "pushLongPollingSuspendTimeout";
  104. /**
  105. * Name of system or context property to write declarative syntax with the
  106. * old "v-" prefix or with the new "vaadin-" prefix. The default value
  107. * depends on the Vaadin branch used.
  108. *
  109. * @see DesignContext
  110. * @since 7.5.7
  111. */
  112. static final String SERVLET_PARAMETER_LEGACY_DESIGN_PREFIX = "legacyDesignPrefix";
  113. // Configurable parameter names
  114. static final String PARAMETER_VAADIN_RESOURCES = "Resources";
  115. static final int DEFAULT_BUFFER_SIZE = 32 * 1024;
  116. static final int MAX_BUFFER_SIZE = 64 * 1024;
  117. final String THEME_DIR_PATH = "VAADIN/themes";
  118. static final int DEFAULT_THEME_CACHETIME = 1000 * 60 * 60 * 24;
  119. static final String WIDGETSET_DIR_PATH = "VAADIN/widgetsets";
  120. // Name of the default widget set, used if not specified in web.xml
  121. static final String DEFAULT_WIDGETSET = "com.vaadin.DefaultWidgetSet";
  122. // Widget set parameter name
  123. static final String PARAMETER_WIDGETSET = "widgetset";
  124. /**
  125. * @deprecated As of 7.1, this message is no longer used and might be
  126. * removed from the code.
  127. */
  128. @Deprecated
  129. static final String ERROR_NO_UI_FOUND = "No UIProvider returned a UI for the request.";
  130. static final String DEFAULT_THEME_NAME = "valo";
  131. static final String INVALID_SECURITY_KEY_MSG = "Invalid security key.";
  132. // portal configuration parameters
  133. static final String PORTAL_PARAMETER_VAADIN_WIDGETSET = "vaadin.widgetset";
  134. static final String PORTAL_PARAMETER_VAADIN_RESOURCE_PATH = "vaadin.resources.path";
  135. static final String PORTAL_PARAMETER_VAADIN_THEME = "vaadin.theme";
  136. static final String PORTLET_CONTEXT = "PORTLET_CONTEXT";
  137. }