loop « JSTL « JSP-Servlet Q&A





1. Accessing Map value in a separate JSTL loop    stackoverflow.com

Assume that a query result exists called resultSet having a field available as templateId. Also, a map 'templateMap' exists with keys of templatedId. I am not able to get any result from the ...

2. Loop through a Map with JSTL    stackoverflow.com

I'm looking to have JSTL loop through a Map and output the value of the key and it's value. For example I have a Map which can have any number of entries, ...

3. Need to loop through 2 arrays at the same time in JSTL    stackoverflow.com

I have two arrays that I need to loop through. Using foreach, I can only loop through one at a time. A regular for(i = 0; i<7; i++) Loop would be ...

4. JSTL c:forEach, decremental number loop impossible?    stackoverflow.com

I want to print decremental numbers like:

<c:forEach var="i" begin="10" end="0" step="-1">
    ... ${i} ...
</c:forEach>
then I got jsp exception:
javax.servlet.jsp.JspTagException: 'step' <= 0
    javax.servlet.jsp.jstl.core.LoopTagSupport.validateStep(LoopTagSupport.java:459)
    ...

5. How to simulate a group-by in JSTL view layer by keeping track of previous & current values while looping over a List?    stackoverflow.com

First I retrieve the Note objects in the service layer:

List<Note> notes = this.getNotes();
Then I pass List of Notes to the view layer and set the same initial value for prevNote and ...

6. How to loop over something a specified number of times in JSTL?    stackoverflow.com

I need a while loop within JSTL. I cannot seem to find how to loop over something a specified number of times. Any ideas how I can accomplish this? I am thinking ...

7.  inside     stackoverflow.com

I was wondering whether the below code is valid? I am working on a project and I come from non java background. Do I need to enclose the <c:otherwise> with <c:choose>? ...

8. jstl - breakig out of a loop early    coderanch.com

9. JSTL question - forEach loop    coderanch.com





10. JSTL looping problem    coderanch.com

Have some problem with JSTL forEach with collections. I can not understand what the problem really is. When sending a collection over to the JSP I get an exception when I try to loop through it with an c:forEach. I have tried with both JSTL 1.1.2 JSP 2.0 and JSTL 1.2 and JSP 2.1 with same result. I am running in ...

11. problem incrementing loop in jstl    coderanch.com

I am trying to loop and create a table that is 4 columns and "X' amount of rows. I did a test to loop 40 "lets say products", this should give me 10 rows of 4 columns, but it is giving me 40 rows of 4 columns i am having trouble incrementing the outer loop as the inner loop loops i ...

12. for loop in jstl    coderanch.com

14. JSTL - total count for loop within a loop    coderanch.com

Hi - here is my dilema, I need to display items in a html table from a Map using JSTL. Every odd table row should have a grey colour and every even should be white (so it looks nice). My data is nested in HashMaps. The first map provies a key to the second map. However the second map may have ...

15. JSTL foreach Loops    coderanch.com

16. JSTL loop    coderanch.com





17. for loop JSTL    coderanch.com

18. How to convert the for Loop to the equalent JSTL code in JSP    coderanch.com

Please post your current code (in a new message). If you use the "var" attribute (set it to something like "details", not "myList", which implies each object is a list) and output myList.firstName it should work. Chances are you're either not retrieving the attribute you think you are, or you're not using the var attribute correctly.

19. JSTL for loop    coderanch.com

Your year goes from 100 years ago until now. For each such year, you're printing the "100 year after" year. Your output probably starts with now and goes 100 years in the future. Try this: <%int year = Integer.parseInt(simpleDateformat.format(date));%>

20. JSTL loop    java-forums.org