If the exception occurs
after the Vaadin UI has been loaded, then Vaadin will show the exception in a
popup (given, that productionMode is false) or then Vaadin will show an error notification.
In case the exception occurs
before the UI has been loaded, then it is your servlet container that manages the exception and it will show an HTML page containing the stack trace. To modify this page, you need to configure your servlet container. How you do this is dependent on which servlet container/applicaiton server you are using.
If you have
custom exception handling in your Vaadin application and you
manually forward the user to an error page, then you need to serve the HTML page through another servlet than a Vaadin servlet (default servlet should be OK). See web.xml/application server documentation for more details.
Well, you see the error page because there was an exception that hindered loading the UI, so you can’t really show the UI unless you know that there won’t be an exception the next time (or you’ll end up in an endless loop). Even in that case, you’d probably need to do some sort of a redirect from the error page (I’m not that familiar with application server configuring, so not sure).
Solved this problem by creating a jsp file. I just created vaadin components shown in a page in the browser and copied the html code from firebug. So the jsp file can be defined in the web.xml as the error page.
Then to show specific data, I saved them into the session (within VaadinSession.getWrappedSession) before an error occurs.