I am running a vaadin application in JBoss 7.1. Whenever there is a exception or error status such as 404 or 500, the default error page of JBoss is displayed. I would like to display a custom error page with the error code and the stack trace of the exception in it instead of the default JBoss error page. Can anyone tell me how to implement this?

Thanks in advance.

有帮助吗?

解决方案

In Vaadin you can add annotation WebServlet like that:

@WebServlet(value = "/*", asyncSupported = true)

and (on a different UI)

@WebServlet(value = "/home/*", asyncSupported = true)

All inesistent url like yourwebsite.com/login go to default page

In JBoss you can add in WEB-INF/web.xml this:

<error-page>
   <error-code>404</error-code>
   <location>/Error404.html</location>
</error-page>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top