However, when user access any non-exist resources, it will display a blank page instead of the 404.htm.

Solution

The 404 error code is configured properly, but it will caused the “.htm” extension handling conflict between the “servlet container” and Spring’s “DispatcherServlet“. To solve it, try change the 404.htm to other file extension, for example 404.jsp.