1,方式一  IDEA配置

   步骤一:点击 edit configurations

   SpringBoot  2.2.5版本 无法跳转jsp页面

 

    步骤二:点击 Environment 

   SpringBoot  2.2.5版本 无法跳转jsp页面

 

    步骤三:点击 working directory 选择第三个,点击应用ok。

   SpringBoot  2.2.5版本 无法跳转jsp页面

 

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

  

 1 @Configuration
 2 public class GlobalConfig {
 3     @Bean
 4     public WebServerFactoryCustomizer<TomcatServletWebServerFactory> customizer() {
 5         return (factory) -> {
 6             factory.addContextCustomizers((context) -> {
 7                         //模块中webapp相对路径
 8                         String relativePath = "tt-web/src/main/webapp";
 9                         File docBaseFile = new File(relativePath);
10                         // 路径是否存在
11                         if (docBaseFile.exists()) {
12                             context.setDocBase(docBaseFile.getAbsolutePath());
13                         }
14                     }
15             );
16         };
17     }
18 }

 

  

  

相关文章:

  • 2021-09-20
  • 2021-12-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-29
  • 2022-12-23
猜你喜欢
  • 2022-01-05
  • 2021-06-28
  • 2021-04-09
  • 2022-12-23
  • 2022-12-23
  • 2021-12-13
  • 2021-05-04
相关资源
相似解决方案