1. c:forEach (6 messages)

    I have the code below. When processing the page, the forEach seems to be working since I get the correct number of option items. But, the value of ${min} is displayed literally (the value and display of the option tag is the literal string "${min}"). I want it to show the value of min. What am I doing wrong?

    <c:forEach var="min" begin="120" end="1440" step="15">
      <option value="<c:out value='${min}' />"><c:out value="${min}" /></option>

    Threaded Messages (6)

  2. jstl i assume[ Go to top ]

    What's the servlet/jsp versions of the container you're running on. If you downloaded the latest JSTL libraries, be sure you're using the 2.4 schema definition in web.xml and not the 2.3 or earlier DTD definition. This only applies if you're using servlet 2.4

    If you're running on an earlier container, download JSTL 1.0 instead.

    Schema definition of web.xml:

    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
        xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
  3. Still having issues[ Go to top ]

    Ok, I downloaded JSTL 1.0.6, updated my web xml to referance...


    Have a reference at the top of the JSP page to...

    <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>

    and the results are still the same: the ${min} isn't being evaluated
  4. Still having issues[ Go to top ]

    Is there maybe a way to do this w/ the struts tags? All I need to do is loop from one value to another with a certain step and output the index value. I realize I could do this w/ scriptlet code, but it just seems silly that it's this difficult w/ the Struts and/or JSTL tags.
  5. Runs fine for me[ Go to top ]

    I ran your code snippet in my JSP and it works fine. I suppose your JSTL library is not loaded properly. Try referencing the JAR file in the <taglib-location> of your web dep. descriptor and make sure it is loaded in your web app correctly
  6. Still having issues[ Go to top ]

    I had the same problem, printing ${item} instead of value of ${item}. It got solved by using 2.4 xsd given below (as mentioned by another respondent):
    Btw, my web.xml had reference to doctype of 2.2 DTD before this!!
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
        xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
  7. Re: Still having issues[ Go to top ]

    Hii U have to use "" instead of ' ' for printing the ${item} "> will work for u. also if u need to display it as a comobo box ( u have used the tag, u have to use the tag also :-) "> should solve ur problem.