summaryrefslogtreecommitdiffstats
path: root/server/src
diff options
context:
space:
mode:
Diffstat (limited to 'server/src')
-rw-r--r--server/src/com/vaadin/server/BootstrapHandler.java9
-rw-r--r--server/src/com/vaadin/server/VaadinServlet.java23
-rw-r--r--server/src/com/vaadin/ui/UI.java40
3 files changed, 28 insertions, 44 deletions
diff --git a/server/src/com/vaadin/server/BootstrapHandler.java b/server/src/com/vaadin/server/BootstrapHandler.java
index 9a0e4c2071..f4da147667 100644
--- a/server/src/com/vaadin/server/BootstrapHandler.java
+++ b/server/src/com/vaadin/server/BootstrapHandler.java
@@ -239,10 +239,13 @@ public abstract class BootstrapHandler implements RequestHandler {
head.appendElement("meta").attr("http-equiv", "Content-Type")
.attr("content", "text/html; charset=utf-8");
- // Chrome frame in all versions of IE (only if Chrome frame is
- // installed)
+ /*
+ * Enable Chrome Frame in all versions of IE if installed.
+ *
+ * Claim IE10 support to avoid using compatibility mode.
+ */
head.appendElement("meta").attr("http-equiv", "X-UA-Compatible")
- .attr("content", "chrome=1");
+ .attr("content", "IE=10;chrome=1");
String title = response.getUIProvider().getPageTitle(
new UICreateEvent(context.getRequest(), context.getUIClass()));
diff --git a/server/src/com/vaadin/server/VaadinServlet.java b/server/src/com/vaadin/server/VaadinServlet.java
index 8385fb2a16..67f3691855 100644
--- a/server/src/com/vaadin/server/VaadinServlet.java
+++ b/server/src/com/vaadin/server/VaadinServlet.java
@@ -206,11 +206,7 @@ public class VaadinServlet extends HttpServlet implements Constants {
@Override
protected void service(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
- /*
- * Some servlet containers cause problems with requests to the context
- * root without any ending slash - ensure we avoid such problems by
- * redirecting to an ending slash in these cases. See #9921
- */
+ // Handle context root request without trailing slash, see #9921
if (handleContextRootWithoutSlash(request, response)) {
return;
}
@@ -219,7 +215,22 @@ public class VaadinServlet extends HttpServlet implements Constants {
service(createVaadinRequest(request), createVaadinResponse(response));
}
- private boolean handleContextRootWithoutSlash(HttpServletRequest request,
+ /**
+ * Invoked for every request to this servlet to potentially send a redirect
+ * to avoid problems with requests to the context root with no trailing
+ * slash.
+ *
+ * @param request
+ * the processed request
+ * @param response
+ * the processed response
+ * @return <code>true</code> if a redirect has been sent and the request
+ * should not be processed further; <code>false</code> if the
+ * request should be processed as usual
+ * @throws IOException
+ * If an input or output exception occurs
+ */
+ protected boolean handleContextRootWithoutSlash(HttpServletRequest request,
HttpServletResponse response) throws IOException {
if ("/".equals(request.getPathInfo())
&& "".equals(request.getServletPath())
diff --git a/server/src/com/vaadin/ui/UI.java b/server/src/com/vaadin/ui/UI.java
index 1ac4a6cba0..31a7446e96 100644
--- a/server/src/com/vaadin/ui/UI.java
+++ b/server/src/com/vaadin/ui/UI.java
@@ -114,7 +114,8 @@ public abstract class UI extends AbstractComponentContainer implements
* the caption of the window
*/
public LegacyWindow(String caption) {
- super(caption);
+ super();
+ setCaption(caption);
}
/**
@@ -124,7 +125,8 @@ public abstract class UI extends AbstractComponentContainer implements
* @param content
*/
public LegacyWindow(String caption, ComponentContainer content) {
- super(caption, content);
+ super(content);
+ setCaption(caption);
}
@Override
@@ -530,38 +532,6 @@ public abstract class UI extends AbstractComponentContainer implements
setContent(content);
}
- /**
- * Creates a new empty UI with the given caption. This UI will have a
- * {@link VerticalLayout} with margins enabled as its content.
- *
- * @param caption
- * the caption of the UI, used as the page title if there's
- * nothing but the application on the web page
- *
- * @see #setCaption(String)
- */
- public UI(String caption) {
- this((ComponentContainer) null);
- setCaption(caption);
- }
-
- /**
- * Creates a new UI with the given caption and content.
- *
- * @param caption
- * the caption of the UI, used as the page title if there's
- * nothing but the application on the web page
- * @param content
- * the content container to use as this UIs content.
- *
- * @see #setContent(ComponentContainer)
- * @see #setCaption(String)
- */
- public UI(String caption, ComponentContainer content) {
- this(content);
- setCaption(caption);
- }
-
@Override
protected UIState getState() {
return (UIState) super.getState();
@@ -1219,7 +1189,7 @@ public abstract class UI extends AbstractComponentContainer implements
@Override
@Deprecated
public void setCaption(String caption) {
- throw new IllegalStateException(
+ throw new UnsupportedOperationException(
"You can not set the title of a UI. To set the title of the HTML page, use Page.setTitle");
}