How to get access to job parameters from ItemReader, in Spring Batch?

前端 未结 7 1646
梦谈多话
梦谈多话 2020-11-30 23:29

This is part of my job.xml:


  
    

        
相关标签:
7条回答
  • 2020-12-01 00:11

    While executing the job we need to pass Job parameters as follows:

    JobParameters jobParameters= new JobParametersBuilder().addString("file.name", "filename.txt").toJobParameters();   
    JobExecution execution = jobLauncher.run(job, jobParameters);  
    

    by using the expression language we can import the value as follows:

     #{jobParameters['file.name']}
    
    0 讨论(0)
提交回复
热议问题