Illegal use of < when > -style tag without < choose > its direct parent

0

I'm developing a web application using jsp and servlet page and would like to show the data from my servlet in two repeat structures one with the produots and another with the plots but this error appears.

Illegal use of &lt;when&gt;-style tag without &lt;choose&gt; as its direct parent

Servlet

protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    // TODO Auto-generated method stub
    //response.getWriter().append("Served at: ").append(request.getContextPath());


     try {

            ProdutosDAO dao = new ProdutosDAO();



         String codigo = request.getParameter("codigo");
      int codigo2=   Integer.parseInt(codigo);


codigo2=1;

           List listaProdutos = dao.mostrarProdutos(codigo2);
           request.setAttribute("listaTodosProdutos", listaProdutos);




           List listaParcelas = dao.mostrarParcelas(codigo2);
           request.setAttribute("listaParcela", listaParcelas);

           RequestDispatcher rd =request.getRequestDispatcher("/Compra.jsp");
           rd.forward(request, response);

       } catch (Exception e) {
           System.out.println("Erro na servelet" + e);
       }
}

JSP Page

 <div class="container-fluid">
    <div class="row">
          <c:choose>
            <c:when test="${!empty listaTodosProdutos}">
                <c:forEach items="${requestScope.listaTodosProdutos}" var="registro"> 


                    <div class="col-sm-6 col-md-6">
                      <img class="imagem_produto" src="<c:url value='/produto/imagens?descricao=${registro.codigo}'/>"/>

                    </div>

                    <div class="col-sm-6 col-md-6">
   <div class=""><c:out value = "${registro.descricao}"/></div>
     <div class=""><c:out value = "${registro.codigo}"/></div>              

                        <div class="linha_compra"></div><br/><br/>
                        </div>
  </c:forEach>  
   </c:when>
 </c:choose>

 <c:when test="${!empty listaParcela}">
    <c:forEach items="${requestScope.listaParcela}" var="registro"> 
                        <div class="col-sm-6 col-md-6">
                          <input name="valor" class="val" value="${registro.valor}" readonly="readonly"/>
                         </div>
                            <select id="parcelas" name="parcelas">
                                <option value="${registro.prod_parc1}">1x ${registro.prod_parc1}</option>
                                <option value="${registro.prod_parc2}">2x ${registro.prod_parc2}</option>
                                <option value="${registro.prod_parc3}">3x ${registro.prod_parc3}</option>
                                <option value="${registro.prod_parc4}">4x ${registro.prod_parc4}</option>
                                <option value="${registro.prod_parc5}">5x${registro.prod_parc5}</option>
                                <option value="${registro.prod_parc6}">6x${registro.prod_parc6}</option>
                                <option value="${registro.prod_parc7}">7x${registro.prod_parc7}</option>
                                <option value="${registro.prod_parc8}">8x${registro.prod_parc8}</option>
                                <option value="${registro.prod_parc9}">9x${registro.prod_parc9}</option>
                                <option value="${registro.prod_parc10}">10x${registro.prod_parc10}</option>
                            </select><br/><br/>
        </c:forEach>  
     </c:when>


             </div>
                    </div>
    
asked by anonymous 25.02.2018 / 02:18

0 answers