Solucionado (ver solução)
Solucionado
(ver solução)
4
respostas

Não estou conseguindo mapear as rotas.. 404

No console sai isso ao startar a aplicação

2018-03-14 12:45:57.594  INFO 6596 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean  : Servlet dispatcherServlet mapped to [/]
2018-03-14 12:45:57.600  INFO 6596 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'characterEncodingFilter' to: [/*]
2018-03-14 12:45:57.601  INFO 6596 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2018-03-14 12:45:57.601  INFO 6596 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2018-03-14 12:45:57.601  INFO 6596 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'requestContextFilter' to: [/*]
2018-03-14 12:45:58.107  INFO 6596 --- [           main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@770c2e6b: startup date [Wed Mar 14 12:45:54 BRT 2018]; root of context hierarchy
2018-03-14 12:45:58.273  INFO 6596 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2018-03-14 12:45:58.275  INFO 6596 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2018-03-14 12:45:58.325  INFO 6596 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-03-14 12:45:58.326  INFO 6596 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-03-14 12:45:58.390  INFO 6596 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-03-14 12:45:58.528  INFO 6596 --- [           main] o.s.b.a.w.s.WelcomePageHandlerMapping    : Adding welcome page template: index
4 respostas

Fala ai Antônio, de boa ?

Cara, os suas classes e tudo mais, estão no mesmo nível ou subníveis a partir da classe Boot ?

Oi Matheus, coloquei a classe controlle no mesmo nivel que a classe que roda o Spring e funcionou corretamente mas gostaria de serapa-las em pacotes diferentes. Como faço isso?

solução!

Você pode separar em pacotes, desde que na pasta raiz tenha i boot, tipo isso:

br.com.caelum.projeto

  • boot.java

br.com.caelum.projeto.pacotes.infinitos

  • suas outras classes

Certo, muito obrigado Matheus!