I understand that there is no mapping for the "dispatcher" servlet, but how and where to add it to the project without using web.xml, (everything is annotated)? Or am I misunderstanding something?
<link href="${pageContext.request.contextPath}css/bootstrap.css" rel="stylesheet"> WebAppConfig:
@Override public void addResourceHandlers(ResourceHandlerRegistry registry) { registry.addResourceHandler("/pages/**").addResourceLocations("/pages/"); } @Bean public UrlBasedViewResolver urlBasedViewResolver(){ UrlBasedViewResolver resolver = new UrlBasedViewResolver(); resolver.setPrefix("/pages/"); resolver.setSuffix(".jsp"); resolver.setViewClass(JstlView.class); return resolver; } and accordingly:
WARNING: No mapping found for HTTP request with URI [/css/bootstrap.css] in DispatcherServlet with name 'dispatcher' окт 02, 2016 9:35:39 PM org.springframework.web.servlet.DispatcherServlet noHandlerFound WARNING: No mapping found for HTTP request with URI [/css/style.css] in DispatcherServlet with name 'dispatcher' окт 02, 2016 9:35:39 PM org.springframework.web.servlet.DispatcherServlet noHandlerFound WARNING: No mapping found for HTTP request with URI [/css/font-awesome.css] in DispatcherServlet with name 'dispatcher'
registry.addResourceHandler("/pages/**")indicates that requests should be:<link href="${pageContext.request.contextPath}pages/css/bootstrap.css" rel="stylesheet">, andaddResourceLocations("/pages/")indicates the location of resources, in this casesrc/main/resources/webapp/pages/css- MrFylypenko