SpringBoot 2.2.5版本 无法跳转jsp页面


1,方式一  IDEA配置

   步骤一:点击 edit configurations

   

 

    步骤二:点击 Environment 

   

 

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

   

 

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 }

 

  

  


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM