Alguem pode me ajudar a resolver o seguinte erro? (obs: Na aula o home dele é um jsp, eu estou usando um html mesmo)
Sep 13, 2018 4:09:20 PM org.springframework.web.servlet.DispatcherServlet noHandlerFound
WARNING: No mapping found for HTTP request with URI [/mantersistema/WEB-INF/home.html] in DispatcherServlet with name 'dispatcher'
Minha classe HomeController:
package br.com.mantersistema.crud.controllers;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
@Controller
public class HomeController {
@RequestMapping("/")
public String index() {
System.out.println("Entrando");
return "home";
}
}
Minha classe ServeletSpringMVC:
package br.com.mantersistema.crud.conf;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
public class ServeletSpringMVC extends AbstractAnnotationConfigDispatcherServletInitializer {
@Override
protected Class<?>[] getRootConfigClasses() {
// TODO Auto-generated method stub
return null;
}
@Override
protected Class<?>[] getServletConfigClasses() {
// TODO Auto-generated method stub
return new Class[] {AppWebConfig.class};
}
@Override
protected String[] getServletMappings() {
return new String[] {"/"};
}
}
Minha classe AppWebConfig:
package br.com.mantersistema.crud.conf;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.view.InternalResourceViewResolver;
import br.com.mantersistema.crud.controllers.HomeController;
@EnableWebMvc
@ComponentScan(basePackageClasses= {HomeController.class})
public class AppWebConfig {
@Bean
public InternalResourceViewResolver internalResourceViewResolver() {
InternalResourceViewResolver resolver = new InternalResourceViewResolver();
resolver.setPrefix("/WEB-INF/");
resolver.setSuffix(".html");
return resolver;
}
}