how to get the element of a list inside jsp using JSTL?

前端 未结 3 1035
悲哀的现实
悲哀的现实 2020-12-15 07:24

I have such this code inside my Spring MVC java controller class:

@RequestMapping(value = \"jobs\", method = { RequestMethod.GET })
public String jobList(@Pa         


        
3条回答
  •  旧巷少年郎
    2020-12-15 08:17

    In my opinion, the right answer is a combination of both of the answers you got:

    use varStatus attribute of c:foreach tag

    but:

    "get" is not a jstl function.

    
       
      
    ${jobs.topic} ${stats[i.index].no}

    EDIT: this is the code finally used by the author of the question:

    
    
       
      
    ${jobs[i.index].topic} ${stats[i.index].no} ${jobID}

提交回复
热议问题