IDEA的springboot集成jsp找不到页面的解决方式1.方式一:IDEA配置步骤一:点击edit configurations…

idea安装本地springboot(IDEA的springboot集成jsp找不到页面的解决方式)(1)

步骤2:点击Environment

idea安装本地springboot(IDEA的springboot集成jsp找不到页面的解决方式)(2)

步骤3:点击working directory 选择第三个,然后点击apply,ok就能访问jsp页面

idea安装本地springboot(IDEA的springboot集成jsp找不到页面的解决方式)(3)

2.方式二:添加一个配置文件

@Configuration public class GlobalConfig { @Bean public WebServerFactoryCustomizer<TomcatServletWebServerFactory> customizer() { return (factory) -> { factory.addContextCustomizers((context) -> { //模块中webapp相对路径 String relativePath = "tt-web/src/main/webapp"; File docBaseFile = new File(relativePath); // 路径是否存在 if (docBaseFile.exists()) { context.setDocBase(docBaseFile.getAbsolutePath()); } } ); }; } }

,