I'm getting error 404 while trying to access my spring boot app on Amazon Elastic Bean Stalk

前端 未结 4 2103
北荒
北荒 2021-01-17 14:51

I developed a spring boot application and I\'ve put the following entries in src/main/resources/application.properties:

spring.mvc.         


        
4条回答
  •  梦毁少年i
    2021-01-17 15:35

    If you check the Spring Boot docs, its clear that you are using the wrong directory structure.

    https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-spring-mvc

    By default, Spring Boot serves static content from a directory called /static (or /public or /resources or /META-INF/resources) in the classpath or from the root of the ServletContext ... Do not use the src/main/webapp directory if your application is packaged as a jar. Although this directory is a common standard, it works only with war packaging, and it is silently ignored by most build tools if you generate a jar.

提交回复
热议问题