4 Replies Latest reply on Jan 8, 2009 3:33 PM by asiandub

    foreach help

    scheintod

      Hello forum,


      I'm not getting it. What's wrong here:



      <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                            "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      
      <html xmlns="http://www.w3.org/1999/xhtml"
           xmlns:c="http://java.sun.com/jsp/jstl/core"
           xmlns:h="http://java.sun.com/jsf/html">
      
      <body>
          foreach:
          <c:forEach var="xxx" begin="1" end="5">
              <h:outputText value="item: #{xxx}" />
          </c:forEach>
      </body>
      </html>
      



      results in:


      foreach: item: 
      



      no repetition. no error. nothing.


      (I need c:forEach so that I can iterate over a list and include different templates depending on the list item's values. This was just a test because my list iteration didn't work.)


      Thanks

        • 1. Re: foreach help
          scheintod

          ok ok. didn't look deep enought. the real result is:


          !DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
          <html xmlns="http://www.w3.org/1999/xhtml" xmlns:c="http://java.sun.com/jsp/jstl/core">
          
               <body>
                    foreach:
                    <c:forEach var="xxx" begin="1" end="5">x:
                    </c:forEach>
               </body>
          </html>
          



          which leads to the real question: why aren't jstl tags included siliently?

          • 2. Re: foreach help
            scheintod

            ok. found the solution in the old forum.


            I was using a wrong namespace. Instead of

            xmlns:c="http://java.sun.com/jsp/jstl/core"



            it must be


            xmlns:c="http://java.sun.com/jstl/core"



            • 3. Re: foreach help
              bashan

              Thanks for sharing.
              It is weird, even the newest version of IntelliJ (8.0M1) puts automatically the old tag.

              • 4. Re: foreach help
                asiandub

                thanks for sharing - that problem just drove me crazy...