I\'m looking for a clean way to return customized 404 errorpages in Spring 4 when a requested resource was not found. Queries to different domain types should result in diff
You should follow this article where you can find detailed information about exception handling in Spring MVC projects.
spring-mvc-exception-handling
@ControllerAdvice may help you in this case