2016-08-13 106 views

回答

0

您可以在命令行运行程序接口上执行脚本。

public class Application implements CommandLineRunner{ 

     public static void main(String[] args) throws Exception { 
     SpringApplication.run(Application.class, args); 
     } 

     @Override 
     public void run(String... strings) throws Exception { 
      // Call the batch script here 
     } 
    } 
+0

这看起来像一个有效的答案,但我会想验证的Tomcat启动时,你的问题明确表示,你需要的脚本,它开始前执行前的CommandLineRunner被调用。 –

相关问题