Handle error 404 with Spring controller

后端 未结 5 559
再見小時候
再見小時候 2020-11-29 07:00

I use @ExceptionHandler to handle exceptions thrown by my web app, in my case my app returns JSON response with HTTP status for error

5条回答
  •  忘掉有多难
    2020-11-29 07:17

    You can use servlet standard way to handle 404 error. Add following code in web.xml

    
       404
       /404error.html
    
    

提交回复
热议问题