Loading...
Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

Using Chrome Frame : How To Do It

Charles Anthony
1 decade ago Mar 31, 2010 11:19am

Hi,

As you may know, Chrome Frame is a way of running Google Chrome inside of Internet Explorer, via a plugin. Chrome is approximately one bazillion times better than IE[1], but many organisations may mandate the use of Internet Explorer. If they do, but a little more lax on installing plugins, it would be handy to be able to use Chrome Frame for Vaadin Applications.

I can confirm that, with a tiny bit of configuration, you can get Vaadin apps running in Chrome inside of IE - simply by sending the appropriate header from the initial "bootstrap page".

Here is an example of an extended application servlet, appropriately configured. Buy referring to ExampleApplicationServlet below instead of com.vaadin.terminal.gwt.server.ApplicationServlet in your web.xml, you can make your applications use Chrome Frame if it installed.

(It would also be possible to do a redirect and ask-to-install, if you wanted to; that's not a requirement of ours).

As you can see it's very, very easy, so I thought I'd share.

Cheers,

Charles.

[1] That may not be scientifically provable. Other limits and restrictions may apply. Your mileage may vary.

@SuppressWarnings("serial")
public class ExampleApplicationServlet extends ApplicationServlet {
  
  @Override
  protected void setAjaxPageHeaders(HttpServletResponse response) {
   super.setAjaxPageHeaders(response);
   response.addHeader("X-UA-Compatible", "chrome=1");
  }
}