Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Open Source Projects
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Ron McLeod
Paul Clapham
Devaka Cooray
Tim Cooke
Sheriffs:
Rob Spoor
Liutauras Vilda
paul wheaton
Saloon Keepers:
Tim Holloway
Tim Moores
Mikalai Zaikin
Carey Brown
Piet Souris
Bartenders:
Stephan van Hulst
Forum:
Other Open Source Projects
freemarker loop
Edward Chen
Ranch Hand
Posts: 798
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
not sure freemarker question could be placed here ?
how to get object from List using its index ? like aList.get(0)
<#assign fldList =.....> <#assign count = 5> <#list 0..count as i> ${fldList.get(i)} // ? </#list>
or we have another way ?
another question is, how to do if-else shorthand, like "int dddd = (blurb) ?a : b " ?
Thanks.
David Newton
Author
Posts: 12617
I like...
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
No, since FreeMarker isn't
JSP
.
Why would you want to? Just iterate over the list.
(I'm not actually sure where to put it though; "Other Languages" for now.)
Campbell Ritchie
Marshal
Posts: 79826
388
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I think you are right to move this
thread
here, David, but I personally know less than nothing about Freemarker.
Ulf Dittmer
Rancher
Posts: 43081
77
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Probably better in "Other Open Source Projects".
I think the proper syntax would be "fldList[i]".
I'm not aware of an if/else shorthand.
@Campbell: You may want to become familiar with FreeMarker, it's what JForum uses for the view layer :-)
Our first order of business must be this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
question from nikos blog(generics)
JSP query! Can anyone give solution for this
priority queue based on unsorted list(Java's LinkedList Class)
Struts: How to validate list
Problem with placeholders of Resource Bundle file when upgaraded to Freemarker 2.3.18 jar
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
More...