Pessoal, boa noite.
No meu projeto, está ocorrendo um erro que ao acessar a página principal(http://localhost:8080/casadocodigo/) sem estar logado no sistema, a página não importa o css, apenas o HTML, alguém consegue me ajudar pois ao acompanhar o instrutor vi que esse erro não acontece no projeto dele, abaixo informações:
@EnableWebMvc
@ComponentScan(basePackageClasses= {HomeController.class, ProdutoDAO.class, FileSaver.class, CarrinhoCompras.class})
@EnableCaching
public class AppWebConfiguration extends WebMvcConfigurerAdapter {
@Bean
public InternalResourceViewResolver internalResourceViewResolver() {
InternalResourceViewResolver resolver = new InternalResourceViewResolver();
resolver.setPrefix("/WEB-INF/views/");
resolver.setSuffix( ".jsp");
resolver.setExposedContextBeanNames("carrinhoCompras");
return resolver;
}
@Bean
public MessageSource messageSource(){
ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
messageSource.setBasename("/WEB-INF/messages");
messageSource.setDefaultEncoding("UTF-8");
messageSource.setCacheSeconds(1);
return messageSource;
}
@Bean
public FormattingConversionService mvcConversionService() {
DefaultFormattingConversionService conversionService =
new DefaultFormattingConversionService();
DateFormatterRegistrar registrar = new DateFormatterRegistrar();
registrar.setFormatter(new DateFormatter("dd/MM/yyyy"));
registrar.registerFormatters(conversionService);
return conversionService;
}
@Bean
public MultipartResolver multipartResolver(){
return new StandardServletMultipartResolver();
}
@Bean
public RestTemplate restTemplate(){
return new RestTemplate();
}
@Override
public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
configurer.enable();
}
@Bean
public CacheManager cacheManager() {
CacheBuilder<Object, Object> builder = CacheBuilder.newBuilder()
.maximumSize(100)
.expireAfterAccess(5, TimeUnit.MINUTES);
GuavaCacheManager manager = new GuavaCacheManager();
manager.setCacheBuilder(builder);
return manager;
}
@Bean
public ViewResolver contentNegotiationViewResolver(ContentNegotiationManager manager){
List<ViewResolver> viewResolvers = new ArrayList<>();
viewResolvers.add(internalResourceViewResolver());
viewResolvers.add(new JsonViewResolver());
ContentNegotiatingViewResolver resolver = new ContentNegotiatingViewResolver();
resolver.setViewResolvers(viewResolvers);
resolver.setContentNegotiationManager(manager);
return resolver;
}
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/resources/**").addResourceLocations("/resources/css", "/resources/imagens","resources/js");
}
}