我正在构建一个Spring Boot应用程序,需要在使用@Bean注释的方法中读取命令行参数.请参阅示例代码:@H_301_2@
@H_301_2@
@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class,args);
}
@Bean
public SomeService getSomeService() throws IOException {
return new SomeService(commandLineArgument);
}
}
我怎样才能解决我的问题?
最佳答案