Uploaded image for project: 'Spring Batch Admin'
  1. Spring Batch Admin
  2. BATCHADM-228

manager/jobs/json/executions.flt is formatting ${jobExecutionInfo} in JSON

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.3.1
    • Fix Version/s: None
    • Component/s: Manager
    • Labels:
      None

      Description

      Minor issue in template manager/jobs/json/executions.ftl:

      	"jobExecutions" : {<#list jobExecutions as jobExecutionInfo><#assign url><@spring.url relativeUrl="${servletPath}/jobs/executions/${jobExecutionInfo.id?c}.json"/></#assign>
      		"${jobExecutionInfo.id}" : {
      
      
      "${jobExecutionInfo.id}"
      

      will fail in case of jobExecutionInfo.id > "1000", because it get formatted... The Json result will be e.g.

      "jobExecutions" : {
      "1,000" : {

      but it should be

      "jobExecutions" : {
      "1000" : {

      Simple fix, just change

      "${jobExecutionInfo.id}"

      to

      "${jobExecutionInfo.id?c}"

      , like in the url generation one line above in the template file.

      Workaround is currently possible - as described in Spring Batch Admin User Guide - by creating a new file WEB-INF/web/manager/jobs/json/executions.ftl with the fixed template in the war archive of the web application.

      ...

      	<#if jobExecutions?? && jobExecutions?size!=0>
      	"jobExecutions" : {<#list jobExecutions as jobExecutionInfo><#assign url><@spring.url relativeUrl="${servletPath}/jobs/executions/${jobExecutionInfo.id?c}.json"/></#assign>
      		"${jobExecutionInfo.id?c}" : {
      			"status" : "${jobExecutionInfo.jobExecution.status}",
      

      ...

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            rmontag Rainer Montag
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: