tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Billy Bacon <billy.ba...@thirty3.net>
Subject Re: How can I convert this to JSTL?
Date Tue, 16 Sep 2003 02:16:13 GMT
Yea, I need to access the 'suggestionList' EL variable from within a
scriplet. I don't prefer to use scriplets in my JSPs but in this case I
don't think I can get around it because this loop that I'm in is creating
javascript.

Here's what the JSP currently looks like...


<script language="javascript">
<!--

var suggestions = new Array();
var replaceWin = null;

<c:forEach items="${SPELL_CHECK_SUGGESTIONS_BEAN}" var="suggestionList"
varStatus="count">
suggestions[<c:out value="${count.index}"/>] = new Array("<c:out
value='${suggestionList.key}'/>");
<% String[] suggs =
(String[])((java.util.Map.Entry)suggestionList).getValue();

int len = suggs.length;
for (int i=0; i < len; i++) {
%>
    suggestions[<c:out value="${count.index}"/>][<%= i+1 %>] = "<%= suggs[i]
%>";
<%
}
%>
</c:forEach>

....

</script>


This use to work when I had the <logic:iterate> Struts tag that defined the
suggestionList variable since that allowed scriplets to access it...


Mime
View raw message