CodeStar Spring Boot项目返回404
我有一个CodeStar Spring Boot项目。当我通过管道推送代码时,构建和部署成功。但是当我访问应用程序的URL时,我会得到一个404代码 同时,当我在localhost上运行应用程序时,webapp工作正常 我认为问题一定出在索引页的位置,所以我将index.html/jsp放在3个不同的位置,但这仍然没有帮助。这是我的结构: 如您所见,我有静态、静态/模板和webapp/WEB-INF/views中的索引页。但这没用。我仍然得到404错误。当我在localhost上运行应用程序时,这些资产来自static/templates文件夹 这是我的控制器CodeStar Spring Boot项目返回404,spring,spring-boot,http-status-code-404,aws-codestar,Spring,Spring Boot,Http Status Code 404,Aws Codestar,我有一个CodeStar Spring Boot项目。当我通过管道推送代码时,构建和部署成功。但是当我访问应用程序的URL时,我会得到一个404代码 同时,当我在localhost上运行应用程序时,webapp工作正常 我认为问题一定出在索引页的位置,所以我将index.html/jsp放在3个不同的位置,但这仍然没有帮助。这是我的结构: 如您所见,我有静态、静态/模板和webapp/WEB-INF/views中的索引页。但这没用。我仍然得到404错误。当我在localhost上运行应用程序
@Controller
public class MainController {
@RequestMapping("/")
public String root() {
return "redirect:/index";
}
@RequestMapping("/index")
public String index(Model model) {
return "index";
}
}
有谁知道,我怎样才能解决这个问题