On Thu, 20 Jan 2005 21:53:23 +0800, PC Leung <[EMAIL PROTECTED]> wrote:
> <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> > > Then I substring the ending characters with the following codes. > > <logic:iterate id="tab" name="tabList" > type="org.apache.struts.tiles.beans.MenuItem" > > <% > ... > String suffix = ${fn:substringAfter(tab.getValue(), ".")}; > if ((suffix == "gif") || (suffix == "jpeg")) { > ... > %> > > It fails to substring!!! Your mixing scriptlets and JSTL looks a bit weird. Try following code: <c:forEach var="tab" items="${tabList}"> <c:set var="suffix" value="${fn:substringAfter(tab.value, '.')}"/> <c:if test="${(suffix == 'gif') or (suffix == 'jpeg'))"> ... </c:if> </c:forEach> Pavel --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]