1

i want to redirect all 404 errors to a error page, i have created a controllerAdvice but my method does not catch 404 error, i am using spring 3.3 throwExceptionIfNoHandlerFound to true does not work

@ExceptionHandler(NoSuchRequestHandlingMethodException.class)
    public ModelAndView handleNoSuchRequestHandlingMethod(final NoSuchRequestHandlingMethodException ex)
    {
        final ModelAndView mav = new ModelAndView(ERRORJSP);

        return mav;
    }
Siva
  • 1,938
  • 1
  • 17
  • 36
  • Possible duplicate of [Handle error 404 with Spring controller](http://stackoverflow.com/questions/13356549/handle-error-404-with-spring-controller) – Prabhat Jul 19 '16 at 10:34

1 Answers1

-1

The evergreen <error-page> in web.xml could do the job.

angcap
  • 149
  • 2
  • 9