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.doHandlePageException(PageContextI
mpl.java:848)
 
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java:781)
 
org.apache.jsp.view.unmatchedPayments_jsp._jspService(org.apache.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(JspServletWrapper.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(ReplyHeaderFilter.ja
va:81)

root cause 

 

 

Can anyone please help me out?

 

Thanks,

Suneetha.

 

 

 

 

 

 

 

 

 

 

Reply via email to