Jsp-el again .

hi all,

I want to re-write the following scriptlet code using el . I've achieved some succes but Iam getting stuck in the <break> syntax. how do i stop the loop processing on some condition.

for reference iam posting my original working code using scriplet tags.

Please help .

and Thanks in advance.

<%

/*

this needs the URL that shows the latest thumbnail. In fact, perhaps the three latest thumbnails... */

photolink = "Sorry, there are no photos recorded at this site.";

ArrayList photos = (ArrayList)((MapBean)pageContext.getAttribute("map")).getPhotos();

for(int j = 0 ; j<photos.size(); j++)

{

if(j==4)break;

if(j==0){

photolink = "Click to view full-size:<br>";

}

spb =(SitePhotoBean)photos.get(j);

photoid = spb.getPhotoid();

photolink += "<a href='http://147.147.2.91:7001/pfk-deploy/GetImage?photo=" + photoid + "' target='_New'><img src='http://147.147.2.91:7001/pfk-deploy/thumbnail.do?photo=" + photoid +"' border=0 width=75 height=56></a>牋";

}

%>

[1138 byte] By [Nidhi@BTa] at [2007-10-3 2:27:48]
# 1

<c:set var = "photolink" value = "Sorry, there are no photos recorded at this site."/>

<c:forEach var = "photo" items = "${map.photos}" begin = "0" end = "3" varstatus = "status">

<c:if test = "${status.count == 0}>

<c:set var = "photolink" value = "Click to view full-size:<br>"/>

</c:if>

<c:set var = "photolink" value = "${photolink}<a href='http://147.147.2.91:7001/pfk-deploy/GetImage?photo=${photo.id}' target = '_New' ><img src='http://147.147.2.91:7001/pfk-deploy/thumbnail.do?photo=${photo.id} border=0 width=75 height=56></a>"/>

</c:forEach>

ram.

Madathil_Prasada at 2007-7-14 19:26:52 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
hi ram,Many thanks again .. Just one more and hopefully last question , in the following if <c:if test = "${status.count == 0}>count starts with 0 or 1 .Just need to confirm this ..Thanks..">
Nidhi@BTa at 2007-7-14 19:26:52 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
Actually you're right.count starts at 1index starts at 0Both count and index are exposed by the status variableSo make it either ${status.count ==1} or ${status.index == 0}or even ${status.first}Any of those expressions would be
evnafetsa at 2007-7-14 19:26:52 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
That was an oversight - thanks for the correction :)ram.
Madathil_Prasada at 2007-7-14 19:26:52 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...