O'Reilly logo

Vaadin 7 Cookbook by Ondrej Kvasnovsky, Jaroslav Holan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Blocking uncaught exceptions in the production mode

The client's browser is always informed whenever something bad happens on the server and an uncatched exception is thrown.

We can simulate that quite easily. Just create a new application and add the following code there:

protected void init(VaadinRequest request) { VaadinService service = request.getService(); DeploymentConfiguration deploymentConfiguration = service.getDeploymentConfiguration(); boolean productionMode = deploymentConfiguration.isProductionMode(); if (productionMode) { ProductionErrorHandler errorHandler = new ProductionErrorHandler(); setErrorHandler(errorHandler); } final VerticalLayout layout = new VerticalLayout(); layout.setMargin(true); setContent(layout); Button button ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required