On 8/25/05, Kurakula, Suneetha (HCF) <[EMAIL PROTECTED]> wrote: > Hello All, > > I am having problem executing <c-rt:foreach loop>. I am using tomcat5.x > version and jstl1.1 Here is code describing how I am using tags. > > <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%> > <%@ taglib uri="http://java.sun.com/jstl/functions" prefix="f"%> > <%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt" %> <snip/>
You are using 1.0 URIs. Please read [ http://wiki.apache.org/jakarta-taglibs/FrequentlyAskedQuestions ]. To begin with, I'd move to 1.1 (one URI for JSTL core taglib instead of two as you use them) and use EL instead of JSP expressions i.e. ${pmts} instead of <%=pmts%> -Rahul > > <%! > public class Payment > { > public int amount; > public String checkDate; > public int checkNumber; > public Payment(){} > public Payment(int amount,String checkDate,int checkNumber) > { > this.amount = amount; > this.checkDate = checkDate; > this.checkNumber = checkNumber; > } > } > Payment pmtone = new Payment(100,"08/12/2005",1000); > Payment pmttwo = new Payment(200,"08/13/2005",2000); > Payment pmtthree = new Payment(300,"08/15/2005",3000); > Payment[] pmts = {pmtone,pmttwo,pmtthree}; > %> > > <%pageContext.setAttribute("pmts",pmts,page);%> > > <c-rt:forEach var="pmt" items="<%=pmts%>" varStatus="curr"> > <c:set var="amount" value="${pmt.amount}"/> > <c:set var="checkdate" value="${pmt.checkdate}"/> > <c:set var="checknumber" value="${pmt.checknumber}"/> > <c:out value="{amount}"/> > <c:out value="{checkdate}"/> > <c:out value="{checknumber}"/> > </c-rt:forEach> > > I am getting error > An error occurred at line: 33 in the jsp file: /view/unmatchedPayments.jsp > Generated servlet error > Syntax error on token "0", ; expected after this token > > org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandle > r.java:84) > org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:3 > 28) > org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:397) > org.apache.jasper.compiler.Compiler.compile(Compiler.java:288) > org.apache.jasper.compiler.Compiler.compile(Compiler.java:267) > org.apache.jasper.compiler.Compiler.compile(Compiler.java:255) > org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:5 > 56) > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2 > 93) > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) > javax.servlet.http.HttpServlet.service(HttpServlet.java:810) > org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.ja > va:81) > > > Can anyone please help me out? > > Thanks, > > Suneetha. > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]