Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSTL error

 
sonali sawant
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • 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=<cut value="${id.toString()}"/><cut 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 ]
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • 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
  • 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 Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An introduction :
http://java.about.com/od/beginningjava/l/aa_jstl_intro.htm
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic