내 프로젝트에 @EnableWebMvc 주석을 추가하면 Webjars와 favicon이 매핑되지 않습니다. 내가이 말뭉치 주석을 제거 할 때이 문제없이 작동하고@EnableWebMvc annotation이 봄 부팅시 일부 매핑에 영향을 미침
No mapping found for HTTP request with URI [/webjars/bootstrap/4.0.0-beta.2/css/bootstrap.min.css] in DispatcherServlet with name 'dispatcherServlet'
No mapping found for HTTP request with URI [/webjars/jquery/3.2.1/jquery.min.js] in DispatcherServlet with name 'dispatcherServlet'
No mapping found for HTTP request with URI [/favicon.ico] in DispatcherServlet with name 'dispatcherServlet'
, 이것의 이유는 무엇입니까 : 나는 내 webjars 전화 인덱스 페이지를로드 할 때
나는이 경고는 무엇입니까? 이 문제를 어떻게 해결할 수 있습니까? 이 상황에서 무엇을 권장합니까
@ControllerAdvice
public class ControllerExceptionHandler {
@ExceptionHandler(NoHandlerFoundException.class)
public ModelAndView handlerNoHandlerFoundException() {
ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName("errorpage");
modelAndView.addObject("errorTitle", "404 Not Found ");
modelAndView.addObject("errorDescription", "The page you are looking for is not available now!!! ");
System.out.println("ERROR :::::::::::::::::::::: no handler");
return modelAndView;
}
}
:
은 또한에만이 같은 'NoHandlerFoundException'을 처리하기위한이 주석이 필요하십니까?
주석을 제거 할 때 문제없이 작동하는 경우 문제가 무엇인가요? 주석이 없습니다. – eis
@eis 예외 처리를 위해이 주석이 필요합니다. –
질문에 필요한 예외 처리 세부 정보를 추가하십시오. – eis