11 Replies Latest reply on May 17, 2006 4:47 AM by francesco vivoli

    Strange behavior using JSTL (MyFaces)

    Markus Dahm Novice


      the following problem may not be directly linked with Seam. However,
      I'm quite confused, so maybe you can help...

      I want to to use the forEach-Tag like in the following code (dummy.jsp)

      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
      <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
       <h:outputText value="bla" />
       <h:outputText value="#{dummy.list}" />
       <c:forEach items="#{dummy.list}" var="vp">
       <div>Name: <h:outputText value="#{vp}" /></div>

      Yet the output is just:

       [Hello, World]
       <div>Name: </div>

      Notice that there are actually values in the list,
      it's just as if the c:forEach-Tag is completely ignored, while
      h:outputText works fine.

      Finally the code of the bean:

      public class DummyBean implements Dummy {
       public List getList() {
       ArrayList<String> result = new ArrayList<String>();
       return result;

      I'm adding standard.jar to WEB-INF/lib by default. I also tried to put
      it directly into the deploy or default/lib directory or change the URI
      to http://java.sun.com/jsp/jstl/core.

      Alas, none of this worked. Do you have an idea why the above does occur?
      I've got the vague idea the #{} notation may not be appropriate, but
      ${} doesn't work.