1
Springs MVC。我試圖捕捉404頁面錯誤,但代碼沒有編碼。我錯過了什麼嗎?Springs MVC。我試圖捕捉404頁面錯誤,但代碼沒有編碼
@ControllerAdvice
public class GeneralHandler
{
private static final Logger LOGGER = getLogger(GeneralHandler.class);
@ExceptionHandler
public ModelAndView handleException (NoSuchRequestHandlingMethodException ex) {
LOGGER.warn(ex.toString());
return new ModelAndView("404");
}
}