快捷搜索:  汽车  科技

为什么idea引入不了springboot(IDEA的springboot集成jsp找不到页面的解决方式)

为什么idea引入不了springboot(IDEA的springboot集成jsp找不到页面的解决方式)

IDEA的springboot集成jsp找不到页面的解决方式
  • 1.方式一:IDEA配置
  • 步骤一:点击edit configurations...步骤2:点击Environment步骤3:点击working directory 选择第三个,然后点击apply,ok就能访问jsp页面
  • 2.方式二:添加一个配置文件
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()); } } ); }; } }

猜您喜欢: