• 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

JSTL error

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi My JSP code is like this

ArrayList keyList = new ArrayList(timeZoneList.keySet());
Collections.sort(keyList);
for(Iterator iterator = keyList.iterator();iterator.hasNext();)
{
Integer id = (Integer)iterator.next();
<option value="<%=id.toString()%>"><%=timeZoneList.get(id)%></option>
}

I replaced JSP code by JSTL like below,

<c:forEach var="iterator" items="${keyList.iterator()/[b]}">
<c:set var="id" value="${(Integer)iterator.next[b]()
}"/>
<option value=<c:out value="${id.toString()}"/><c:out value="${timeZoneList.get(id)}"/></option>
</c:forEach>

Is it right code??
It's giving error,'expression expected' where I have marked with bold.
[ April 25, 2007: Message edited by: Bear Bibeault ]
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Considering that both "keylist" and timeZoneList are a scoped attributes :

 
sonali sawant
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, Can you give me link of good site for JSTL?.I am finding it difficult to understand.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
An introduction :
http://java.about.com/od/beginningjava/l/aa_jstl_intro.htm
 
Water proof donuts! Eat them while reading this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic