title: spring MVC jsp foreach
body: <p>The calculate method takes two parameters, <code>sessionUser.getUserId()</code> and <code>user.getUserId()</code>,  from the list below.</p>
  
  <p>I want to show the result of this method that returns a String value for each user in jsp. I use <code>c:foreach</code> to display users in jsp page.</p>
  
  <p>How can I do That?</p>
  
  <pre><code>User sessionUser=(User)request.getSession(true).getAttribute("user");
  List&lt;User&gt; users=groupService.getUserGroup(group); 
  model.addAttribute("users",users);
  for(User user:users){
  model.addAttribute("result",
     calculateSililarity.calculate(sessionUser.getUserId(), user.getUserId()));
  }
  </code></pre>