To look for the answers of these kind of questions you should refer to Servlet specification. If you go to page 126 of specification it says:
The Web application may have declared error pages using the exception-type
element. In this case the container matches the exception type by comparing the
exception thrown with the list of error-page definitions that use the exception-type
element. A match results in the container returning the resource indicated in the
location entry. The closest match in the class hierarchy wins.
So closest match here in your case is ArithmaticException so it wins! thats it.