title: Linked selectlists in Spring problem
body: <p>Here variable data should hold the data getJSON-method returns. But is there something wrong? It seems the data is empty.</p>
  
  <pre><code>$(function(){
  $("#subjectgroups").change(function(){
  
  
    $.getJSON("/getSubCategories?id="+$("#subjectgroups").val(), function(data){
    var options = '';
    for (var i = 0; i &lt; data.length; i++) {
      options += '&lt;option value="' + data[i].id + '"&gt;' + data[i].description + '&lt;/option&gt;';
    }
    $("#mainsubjects").html(options);
  
  })
  });
  });
  </code></pre>
  
  <p>When I type the getJSON url on browser, I get the json elements just right, example:</p>
  
  <pre><code>  [{"description":"Religion","id":34},{"description":"uskonto","id":9}] 
  </code></pre>