Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9180995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:11:01+00:00 2026-06-17T18:11:01+00:00

I have such this code inside my Spring MVC java controller class: @RequestMapping(value =

  • 0

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

@RequestMapping(value = "jobs", method = { RequestMethod.GET })
public String jobList(@PathVariable("username") String username, Model model) {
    JobInfo[] jobInfo;
    JobStatistics js;
    LinkedList<JobStatistics> jobStats = new LinkedList<JobStatistics>();
    try {
        jobInfo = uiClient.getJobs(username);
           for (int i = 0; i < jobInfo.length; i++) {
             js = uiClient.getJobStatistics(jobInfo[i].getJobId());
             jobStats.add(js);
           }
        model.addAttribute("jobs", jobInfo);
        model.addAttribute("jobStats", jobStats);
    }

which uiClient will get some data from database using RMI …
now I want to show the jobs & related statistic inside my JSP file using JSTL :

<c:set var="stats" value="${jobStats}" />
        <c:forEach var="jobs" items="${jobs}">
           <c:set var="jobID" value="${jobs.JobId}"/>
          <table>
            <tr class="tr1">
                <td>${jobs.Topic}</td>
                <td>${stats.get(i).No}</td>
            </tr>
          </table>
        </c:forEach>

How do I get the LinkedList elements of Model inside my JSP using JSTL? There might be no no counter i been put in scope for me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T18:11:02+00:00Added an answer on June 17, 2026 at 6:11 pm

    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.

    <c:forEach var="jobs" items="${jobs}" varStatus="i">
       <c:set var="jobID" value="${jobs.jobId}"/>
      <table>
        <tr class="tr1">
            <td>${jobs.topic}</td>
            <td>${stats[i.index].no}</td>
        </tr>
      </table>
    </c:forEach>
    

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

    <c:set var="stats" value="${jobStats}" />
    <c:forEach items="${jobs}" varStatus="i">
       <c:set var="jobID" value="${jobs[i.index].jobId}"/>
      <table>
        <tr class="tr1">
            <td>${jobs[i.index].topic}</td>
            <td>${stats[i.index].no}</td>
            <td>${jobID}</td>
        </tr>
      </table>
    </c:forEach>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I have JS code inside a jsp files, such as this: <% String
I have a file named AttachmentDownload.aspx and inside Page_Load method have such code which
I have written this code to convert string in such format 0(532) 222 22
(Java Spring WebApp) I have: public class PersonValidator implements Validator { private PersonDAO d;
I have this code inside my view. $country = array( 'id' => 'country', 'name'
I have this code: class Program { static void Main(string[] args) { Action whatToDo
Assume I have a controller method like this: [Audit] public JsonNetResult List(int start, int
I have this such query : SELECT au_lname,der.col FROM authors INNER JOIN (SELECT t.au_id,
Lets say a have a string such as this one: string txt = Lore
I have a Listview, such this: <ListView ItemsSource={Binding ...} > <ListView.ItemContainerStyle> <Style TargetType=ListViewItem> <Setter

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.