@RequestMapping(value = "/jobs/executions/{jobExecutionId}/steps/{stepExecutionId}/execution-context", method = RequestMethod.GET)
public String getStepExecutionContext(Model model, @PathVariable Long jobExecutionId, @PathVariable Long stepExecutionId,
@ModelAttribute("date") Date date, Errors errors) {
try {
StepExecution stepExecution = jobService.getStepExecution(jobExecutionId, stepExecutionId);
Map<String, Object> executionMap = new HashMap<String, Object>();
for (Map.Entry<String, Object> entry : stepExecution.getExecutionContext().entrySet()) {
executionMap.put(entry.getKey(), entry.getValue());
}
model.addAttribute("stepExecutionContext", objectMapper.writeValueAsString(executionMap));
model.addAttribute("stepExecutionId", stepExecutionId);
model.addAttribute("stepName", stepExecution.getStepName());
model.addAttribute("jobExecutionId", jobExecutionId);
}
catch (NoSuchJobExecutionException e) {
errors.reject("no.such.job.execution", new Object[] { jobExecutionId }, "There is no such job execution ("
+ jobExecutionId + ")");