tft每日頭條

 > 生活

 > idea安裝本地springboot

idea安裝本地springboot

生活 更新时间:2024-06-29 11:10:28
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()); } } ); }; } }

,

更多精彩资讯请关注tft每日頭條,我们将持续为您更新最新资讯!

查看全部

相关生活资讯推荐

热门生活资讯推荐

网友关注

Copyright 2023-2024 - www.tftnews.com All Rights Reserved