Spring Boot - where to place the jsp files

前端 未结 8 2142
无人及你
无人及你 2020-12-20 15:55

I am trying to develop a new Spring boot application using MVC as a first step to move my existing Spring MVC application to Spring boot.

However, I am facing an is

相关标签:
8条回答
  • 2020-12-20 16:40

    Remove @EnableWebMvc annotation from your Spring Boot class. By default with @SpringBootApplication enables your application as web application. Declaring @EnableWebMvc explicitly will disable the auto configuration and Auto setting up DispatcherServlet will be overridden which is causing you the issue.

    0 讨论(0)
  • 2020-12-20 16:45

    Using the directory src/main/webapp/WEB-INF/jsp/.. is discouraged if you want to deploy via a jar package.

    “Do not use the src/main/webapp folder if your application will be packaged as a jar. Although this folder is a common standard, it will only work with war packaging and it will be silently ignored by most build tools if you generate a jar.”

    Reference: https://docs.spring.io/spring-boot/docs/1.1.4.RELEASE/reference/htmlsingle/#using-boot-structuring-your-code

    0 讨论(0)
提交回复
热议问题