2
다음 컨트롤러 로직이 있습니다. 그러나 존재하지 않는 페이지 (예 :/임의 페이지)로 이동하면 TemplateInputException으로 끝납니다. 어떻게하면 이것을 포착하고 404 페이지로 이동할 수 있습니까? 스프링 부팅핸들 org.thymeleaf.exceptions.TemplateInputException
@ExceptionHandler(Exception.class)
public ModelAndView handleAllException(Exception ex) {
ModelAndView model = new ModelAndView("error/generic_error");
model.addObject("errMsg", "this is Exception.class");
return model;
}
당신이 해결책을 발견해야
Thymeleaf는 무시 ExceptionHandler 것 같다 아직? – Kousalik