On Wed, 26 Jan 2005 14:16:13 +0800, Daniel PC Leung <[EMAIL PROTECTED]> wrote: > The error message looks like this. > > [ServletException in:/layout/tabsLayout.jsp] java.util.ArrayList' > > The tabsLayout.jsp file looks like this. > (How can I solve it? Thanls) > > <logic:iterate id="tab" name="tabList" > type="org.apache.struts.tiles.beans.MenuItem" > > <% > String href = request.getRequestURI() + "?"+parameterName + "=" + index; > String color = notSelectedColor; > if( index == selectedIndex ) > { > selectedBody = tab.getLink(); > color = selectedColor; > } > index++; > %> > <td bgcolor="<%=color%>"> > <c:set var="tab" value="${tabList}"></c:set>
I guess the exception is thrown in the subsequent lines and it's because you over wrote "tab" to the collection (tabList) in the above line from it's initial assignment to each "item" in the collection (tabList) exposed through the "id" attribute of the <logic:iterate/>. Removing the above <c:set/> line should get rid of the exception; > <c:set var="suffix" value="${fn:substringAfter(tab, '.')}"></c:set> > <c:choose> > <c:when test="${(suffix == 'gif') or (suffix == 'jpeg')}"> > <a href="<%=href%>"> <%=tab.getValue()%> </a> > </c:when> > <c:otherwise> > <a href="<%=href%>"> <%=tab.getValue()%> </a> > </c:otherwise> > </c:choose> > </td> > <td width="1" > > </td> > > </logic:iterate> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]