As your class is missing a method "public int getAmount() { return this.amount; }"
it is no bean, so jstl cannot access the property. Add this method and it should work. Bjoern > -----Ursprüngliche Nachricht----- > Von: Kurakula, Suneetha (HCF) [mailto:[EMAIL PROTECTED] > Gesendet: Donnerstag, 25. August 2005 20:27 > An: 'Tag Libraries Users List' > Betreff: RE: Urgent: urgent jstl foreach tag is not working > > Hi Martin, > > Thanks for the response. I defined my > > Usebean for the class I am trying to access > > <jsp:useBean id="pmt" > class="scinsurers.server.interfaces.Payment" /> .But still I > am getting error > > javax.servlet.ServletException: An error occurred while > evaluating custom action attribute "value" with value > "${pmt.amount}": Unable to find a value for "amount" in > object of class "scinsurers.server.interfaces.Payment" using > operator "." (null) > > org.apache.jasper.runtime.PageContextImpl.doHandlePageExceptio > n(PageContextI > mpl.java:848) > > org.apache.jasper.runtime.PageContextImpl.handlePageException( > PageContextImp > l.java:781) > > org.apache.jsp.view.unmatchedPayments_jsp._jspService(org.apac he.jsp.view.un > matchedPayments_jsp:457) > > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) > javax.servlet.http.HttpServlet.service(HttpServlet.java:810) > > org.apache.jasper.servlet.JspServletWrapper.service(JspServlet > Wrapper.java:3 > 22) > > 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(ReplyH > eaderFilter.ja > va:81) > > > Thanks, > Suneetha. > > -----Original Message----- > From: Martin Cooper [mailto:[EMAIL PROTECTED] > Sent: Thursday, August 25, 2005 2:18 PM > To: Tag Libraries Users List > Subject: Re: Urgent: urgent jstl foreach tag is not working > > You need to define getters for the properties you want to > access via JSTL. > > -- > Martin Cooper > > > On 8/25/05, Kurakula, Suneetha (HCF) > <[EMAIL PROTECTED]> wrote: > > Hello All, > > > > > > > > I would like to thank you all who answered my question . I have > > jakarta-taglibs-standard-1.1.2 jars and tlds copied onto > my webserver. > But > > still I am getting error when I run my jsp > > > > > > > > As you all suggested I fixed my jsp syntactical errors and > tag errors. > Here > > is my updated code. > > > > > > > > <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%> > > > > <%@ taglib uri="http://java.sun.com/jstl/functions" prefix="f"%> > > > > > > > > <%! > > > > 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); > > > > for(int i=0;i<pmts.length;i++) > > > > { > > > > System.out.println(pmts[i].amount); > > > > } > > > > %> > > > > > > > > <c: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:forEach> > > > > > > > > And now I am getting error > > > > > > > > javax.servlet.ServletException: An error occurred while evaluating > > custom action attribute "value" with value "${pmt.amount}": > Unable to > > find a > value > > for "amount" in object of class > > "org.apache.jsp.view.unmatchedPayments_jsp$Payment" using > operator "." > > (null) > > > > > org.apache.jasper.runtime.PageContextImpl.doHandlePageExceptio > n(PageContextI > > mpl.java:848) > > > > > org.apache.jasper.runtime.PageContextImpl.handlePageException( > PageContextImp > > l.java:781) > > > > > org.apache.jsp.view.unmatchedPayments_jsp._jspService(org.apac he.jsp.view.un > > matchedPayments_jsp:464) > > > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) > > javax.servlet.http.HttpServlet.service(HttpServlet.java:810) > > > > > org.apache.jasper.servlet.JspServletWrapper.service(JspServlet > Wrapper.java:3 > > 22) > > > > > 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(ReplyH > eaderFilter.ja > > va:81) > > > > root cause > > > > > > > > > > > > Can anyone please help me out? > > > > > > > > Thanks, > > > > Suneetha. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > 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] > > > > ____________ Virus checked by G DATA AntiVirusKit Version: AVK 16.129 from 25.08.2005 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]