wood burning stoves 2.0*
The moose likes JSP and the fly likes JSTL error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "JSTL error" Watch "JSTL error" New topic
Author

JSTL error

sonali sawant
Greenhorn

Joined: Oct 24, 2005
Posts: 13
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

Joined: Nov 24, 2005
Posts: 14688
    
  16

Considering that both "keylist" and timeZoneList are a scoped attributes :



[My Blog]
All roads lead to JavaRanch
sonali sawant
Greenhorn

Joined: Oct 24, 2005
Posts: 13
Hi, Can you give me link of good site for JSTL?.I am finding it difficult to understand.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

An introduction :
http://java.about.com/od/beginningjava/l/aa_jstl_intro.htm
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSTL error