title: spring mvc error ajax [object Object] when return @ResponseBody Map
body: <p>I want to do a concatenated combobox, for that I am using ajax and javascript in the view, the problem is that the controller receives the data and capture me the result but when returned kicks me error can not return Map, I'm using spring mvc. </p>
  
  <p>I already have 2 libraries of json, that's not the problem I think ..</p>
  
  <p>JSP</p>
  
  <p>....
            </p>
  
  <pre><code>       jQuery(document).ready(function() { 
  
          var contexPath = "&lt;%=request.getContextPath()%&gt;";
          $('#anios').change(
              function(e){
                  if(jQuery(this).val() != "-1"){
                      $('#eventos').find('option').remove().end().append(
                          '&lt;option value="-1"&gt;--Select state--&lt;/option&gt;');
                      e.preventDefault();
                      var val = $(this).val();
                      jQuery("#eventos").removeAttr("disabled");
  
                      alert(val);
                      //$('#othstate').val('').hide(); 
                      $.ajax({
                          type : "POST",
                          url : contexPath + '/eventosPublicados.html',
                          dataType : 'json',
                          data : {
                              idAnio : val
                          }, success : function(data){
                              //alert(data.lstEventos);
                              //showEventos(data.lstEventos);
                              // $('#states').html( data.lstStates ); 
                          }, error : function(e) {
                              alert('Error: '+ e);
                          }
                       });
                  } else {
                      $("#eventos").attr("disabled", "disabled");
                      $('#eventos').find('option').remove().end().append(
                      '&lt;option value="-1"&gt;--- Seleccione ---&lt;/option&gt;');
                  }
              });
  
              function showEventos(data) {
                  for (var i = 0, len = data.length; i &lt; len; ++i) {
                      var msajax = data[i];
                      $('#eventos').append(
                      "&lt;option value=\"" +msajax.idEvento + "\"&gt;" + msajax.nombre + "&lt;/option&gt;");
                  }
              }
  
          });
      &lt;/script&gt;
  </code></pre>
  
  <p>..</p>
  
  <p>Controller</p>
  
  <pre><code> @RequestMapping(value= "/eventosPublicados", headers = "Accept=application/json,application/xml")
  public @ResponseBody Map&lt;String, ? extends Object&gt; listaEventosPublicados(@RequestParam(value="idAnio", required=true) String anio) throws Exception{
      Map&lt;String,Object&gt; model = new HashMap&lt;String, Object&gt;();
  
      List&lt;Evento&gt; eventos = this.eventoService.obtenerEventosPublicadosxAnio(Integer.parseInt(anio));
      System.out.println("evento size: " + eventos.size());
  
      model.put("lstEventos", eventos);
  
      return model;
  }
  </code></pre>
  
  <p>If I retrieve the data from the list, which means that if the value "anio" arrives, the problem is to return. </p>
  
  <p>Help me pls</p>