Quando tento acessar http://localhost:8080/casadocodigo/ recebo a messagem: HTTP Status 404 - /casadocodigo/WEB‐INF/views/home.jsp
Mas minha home.jsp esta dentro de webapp/WEB‐INF/views/
Vou deixar código das minhas classes e do jsp
package org.casadocodigo.loja.conf;
import org.casadocodigo.controllers.HomeController;
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;
@EnableWebMvc
@ComponentScan(basePackageClasses={HomeController.class})
public class AppWebConfiguration {
@Bean
public InternalResourceViewResolver internalResourceViewResolver(){
InternalResourceViewResolver resolver = new InternalResourceViewResolver();
resolver.setPrefix("/WEB‐INF/views/");
resolver.setSuffix(".jsp");
return resolver;
}
}
package org.casadocodigo.loja.conf;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
public class ServletSpringMvc extends AbstractAnnotationConfigDispatcherServletInitializer {
@Override
protected Class<?>[] getRootConfigClasses() {
return null;
}
@Override
protected Class<?>[] getServletConfigClasses() {
return new Class[] {AppWebConfiguration.class};
}
@Override
protected String[] getServletMappings() {
return new String[] {"/"}; }
}
package org.casadocodigo.controllers;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class HomeController {
@RequestMapping("/")
public String index(){
//ESTA PASSANDO POR AQUI
System.out.println("Exibindo a home da CDC");
return "home";
}
}
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<h1>Casa do Código</h1>
<table>
<tr>
<td>TDD na Prática ‐ JAVA</td>
<td>Google Android</td>
<td>Certificação OCJP</td>
<td>Java 8 Prático</td>
</tr>
</table>
</body>
</html>