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
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Other Open Source Projects
freemarker loop
Edward Chen
Ranch Hand
Posts: 798
posted 13 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 13 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: 79179
377
posted 13 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 13 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 :-)
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
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...