title: jstl: Failed to parse the expression [${item.class.name == 'List'}]
body: <p>the jstl code below should parse a json file base on this controller method:</p>
  
  <p><strong>controller</strong></p>
  
  <pre><code>@RequestMapping(value="listagem.json", method=RequestMethod.GET)
  @PreAuthorize("hasPermission(#user, 'listagem_'+#this.this.name)")
  public ModelAndView listagem_json(@RequestParam("pagina") String pagina, @RequestParam("items") String items, @RequestParam("ordem") String ordem) {
      ModelAndView mav = new ModelAndView();
  
      mav.setViewName("listagem");        
      mav.addObject("lista", serv.listagem(pagina, items, ordem));
      mav.addObject("map", serv.getListaAtributos());
  
      return mav;
  }
  </code></pre>
  
  <p><strong>jstl code</strong></p>
  
  <pre><code>&lt;%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %&gt;
  &lt;%@ taglib prefix="json" uri="http://www.atg.com/taglibs/json" %&gt;
  &lt;json:object&gt;
      &lt;json:array name="item" var="item" items="${lista}"&gt;
            &lt;json:object&gt;
              &lt;c:forEach var="attr" items="${map}"&gt;
                  &lt;c:choose&gt;
                      &lt;c:when test="${empty attr.value}"&gt;
                          &lt;json:property name="${attr.key}" value="${item[attr.key]}"/&gt;
                      &lt;/c:when&gt;
                      &lt;c:otherwise&gt;
                          &lt;c:choose&gt;
                              &lt;c:when test="${item.class.name == 'List'}"&gt;
                                  &lt;json:array name="${attr.key}" var="attr2" items="${item[attr.key]}"&gt;
                                      &lt;json:object&gt;
                                          &lt;c:forEach var="attr3" items="${attr.value}"&gt;
                                              &lt;json:property name="${attr3}" value="${attr2[attr3]}"/&gt;
                                          &lt;/c:forEach&gt;
                                      &lt;/json:object&gt;
                                  &lt;/json:array&gt;
                              &lt;/c:when&gt;
                              &lt;c:otherwise&gt;
                                  &lt;json:array name="${attr.key}"&gt;
                                      &lt;json:object&gt;
                                          &lt;c:forEach var="attr2" items="${attr.value}"&gt;
                                              &lt;c:set value="${attr.key}" var="object"/&gt;
                                              &lt;json:property name="${attr2}" value="${object}.${attr2}"/&gt;
                                          &lt;/c:forEach&gt;
                                      &lt;/json:object&gt;
                                  &lt;/json:array&gt;
                              &lt;/c:otherwise&gt;
                          &lt;/c:choose&gt;
                      &lt;/c:otherwise&gt;
                  &lt;/c:choose&gt;
              &lt;/c:forEach&gt;
            &lt;/json:object&gt;
      &lt;/json:array&gt;
  &lt;/json:object&gt;
  </code></pre>
  
  <p>But when I run the application and a json file is requested, this error happens:</p>
  
  <pre><code>org.apache.jasper.JasperException: /WEB-INF/json/listagem.jsp (line: 13, column: 9) "${item.class.name == 'List'}" contains invalid expression(s): javax.el.ELException: Failed to parse the expression [${item.class.name == 'List'}]
  </code></pre>
  
  <p>anyone can tell me what the right way to write this expression <code>${item.class.name == 'List'}</code> for accomplish the expected result?</p>