You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Randy Dillon <ra...@sitestuff.com> on 2004/02/20 19:48:01 UTC

Logic:iterate Exception

I have logic that looks like this:

<% int n = 0;
   String strCat = ( (String[]) parms.get("cboCategory") )[n];
   out.println(strCat + strCat + strCat);
%>
<logic:iterate id="cat" indexId="i" 
		   name="parms" property="cboCategory" >
	<logic:greaterThan value="0" name="i">, </logic:greaterThan>
	<%strCat=( (String[]) parms.get("cboCategory") )[n];%>
	<bean:write name="cat" />  
	<%=strCat%>
</logic:iterate>

The scriptlets are strictly for debugging purposes, because the <bean:write... causes this exception:

javax.servlet.jsp.JspException: Cannot find bean cat in scope page
	at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:717)
	at org.apache.struts.taglib.bean.WriteTag.doStartTag(WriteTag.java:290)
	at _pages._product._orderdetail._jspService(orderdetail.jsp:48)

Otherwise, everthing in the code block above works.  In fact, the code block (minus the scriptlets) was copied from another page where it works without fail.  Isn't the parms.get(...) doing the same thing as the <logic:iterate ...> combined with the <bean:write ...>?