title: getting spring mvc model value with javascript
body: <p>I tried whole things what I found on the internet but I failed about this. I investigated all issues on here or other sites but It didn't create any difference. I do something wrong but I can't see.</p>
  
  <p>Now here is my jsp page : </p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script src="&lt;c:url value="/resources/js/jquery-3.2.1.min.js" /&gt;"&gt;&lt;/script&gt;
  &lt;link href="&lt;c:url value="/resources/css/bootstrap.css" /&gt;" rel="stylesheet"/&gt;
  &lt;link href="&lt;c:url value="/resources/css/bootstrap-theme.css"/&gt;" rel="stylesheet"/&gt;
  &lt;script type="text/javascript"&gt;
      debugger;
      var allEmployees = "${allEmployees}";
      debugger;
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div class="table-responsive"&gt;
  &lt;h2&gt;Tüm Çalışanlar&lt;/h2&gt;
  &lt;table class="table table-bordered"&gt;
      &lt;div class="row"&gt;
          &lt;div class="col-md-12"&gt;
              &lt;tr&gt;
                  &lt;td class="field-label col-xs-3 active"&gt;
                      &lt;label&gt;TC No&lt;/label&gt;
                  &lt;/td&gt;
                  &lt;td class="field-label col-xs-3 active"&gt;
                      &lt;label&gt;Ad&lt;/label&gt;
                  &lt;/td&gt;
                  &lt;td class="field-label col-xs-3 active"&gt;
                      &lt;label&gt;Soyad&lt;/label&gt;
                  &lt;/td&gt;
                  &lt;td class="field-label col-xs-3 active"&gt;
                      &lt;label&gt;Başlama Tarihi&lt;/label&gt;
                  &lt;/td&gt;
                  &lt;td class="field-label col-xs-3 active"&gt;
                      &lt;label&gt;Maaş&lt;/label&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;c:if test="${not empty allEmployees}"&gt;
          &lt;c:forEach items="${allEmployees}" var="employee"&gt;
              &lt;tr&gt;
                  &lt;div class="row"&gt;
                      &lt;div class="col-md-12"&gt;
                          &lt;td&gt;${employee.citizenNumber}&lt;/td&gt;
                          &lt;td&gt;${employee.name}&lt;/td&gt;
                          &lt;td&gt;${employee.surname}&lt;/td&gt;
                          &lt;td&gt;${employee.joiningDate}&lt;/td&gt;
                          &lt;td&gt;${employee.salary}&lt;/td&gt;
                          &lt;td&gt;
                              &lt;a href="&lt;c:url value='/edit-${employee.oid}-employee' /&gt;"&gt;${employee.oid}&lt;/a&gt;
                          &lt;/td&gt;
                          &lt;td&gt;
                              &lt;a href="&lt;c:url value='/delete-${employee.oid}-employee' /&gt;"&gt;delete&lt;/a&gt;
                          &lt;/td&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/tr&gt;
          &lt;/c:forEach&gt;
      &lt;/c:if&gt;
  &lt;/table&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>and here is my controller:</p>
  
  <pre><code>@Controller
  @RequestMapping("/employee")
  public class EmployeeController {
  
  @Autowired
  EmployeeService employeeService;
  
  @RequestMapping(value = {"/","/list"},method = RequestMethod.GET)
  public String lisEmployees(Model model){
      List&lt;Employee&gt; employees = employeeService.findAllEmployees();
  
      model.addAttribute("allEmployees",employees);
  
      return "allemployees";
  
    }
  }
  </code></pre>
  
  <p>I debugged on firebug but I can't handle model value and here investigate my jsp pages html code I try to fill a table with model value but it can't fill. I debugged controller and employees list have a record and model have allEmployees key to mapped employees list.</p>
  
  <p>So where am I wrong? How to I cope with this? Please, Could you help me?</p>