"None of tags will work .They will just print out ${amount} and
{fn.length(pmts)} instead of values"


I assume you're putting them within a <c:out...> and not just expecting
${amount} to print something in the JSP. 




-----Original Message-----
From: Kurakula, Suneetha (HCF) [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 25, 2005 2:47 PM
To: 'Tag Libraries Users List'
Subject: RE: Urgent: urgent jstl foreach tag is not working

Hi,

I am sorry for pestering you. But I need your help desperately. Please
let
me clarify with you about my JSTL setup. 

1.Downloaded jakarta-taglibs-standard-1.1.2 
2.Copied jstl.jsr,standard.jar to web-inf/lib 
3.Copied tlds to web-inf/tlds folder
4.Added taglibs to web.xml as below
 <taglib>
   <taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
   <taglib-location>/WEB-INF/tlds/c.tld</taglib-location>
 </taglib>  
 
 <taglib>
   <taglib-uri>http://java.sun.com/jsp/jstl/functions</taglib-uri>
   <taglib-location>/WEB-INF/tlds/fn.tld</taglib-location>
 </taglib>

If I use below tag uris 
<%@ taglib  uri="http://java.sun.com/jsp/jstl/core"; prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions"; prefix="fn"%>

None of tags will work .They will just print out ${amount} and
{fn.length(pmts)} instead of values

And if I use 
<%@ taglib  uri="http://java.sun.com/jstl/core"; prefix="c"%>
<%@ taglib uri="http://java.sun.com/jstl/functions"; prefix="fn"%>


Alteast core  tags are working and prints values and function tags they
just
print {fn.length(pmts)}.


Can anyone let me know if I am missing anything in my configuration?

Thanks
Suneetha


-----Original Message-----
From: Martin Cooper [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 25, 2005 3:29 PM
To: Tag Libraries Users List
Subject: Re: Urgent: urgent jstl foreach tag is not working

On 8/25/05, Kurakula, Suneetha (HCF) <[EMAIL PROTECTED]>
wrote:
> Hi All,
> Great.
> Thank you very much . I got it resolved by adding getters method to my
class
> as suggested by Martin. Thanks Martin.
> 
> I have one more problem. My core tags are working in the same page but
> function tags values are not printing

That's because you're using JSTL 1.0 URIs but trying to use JSTL 1.1
functionality. If you correct your URIs, it should work (assuming you
actually have a JSTL 1.1 implementation).

--
Martin Cooper


> <%@ taglib  uri="http://java.sun.com/jstl/core"; prefix="c"%>
> <%@ taglib uri="http://java.sun.com/jstl/functions"; prefix="fn"%>
> 
> <c:set var="tempStr" value="I love Java an www.java2s.com"/>
> ${fn:length(tempStr)}
> Payments length = ${fn:length(pmts)}
> 
> Can anyone please help me out?
> 
> Thanks,
> Suneetha.
> 
> -----Original Message-----
> From: Martin Cooper [mailto:[EMAIL PROTECTED]
> Sent: Thursday, August 25, 2005 2:32 PM
> To: Tag Libraries Users List
> Subject: Re: Urgent: urgent jstl foreach tag is not working
> 
> On 8/25/05, Kurakula, Suneetha (HCF) <[EMAIL PROTECTED]>
wrote:
> > Hi Martin,
> >
> > Thanks for the response. I defined my
> >
> > Usebean for the class I am trying to access
> 
> You don't need that. As I said, what you _do_ need is getters. Like:
> 
>   public int getAmount() { return amount; }
> 
> --
> Martin Cooper
> 
> 
> > <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.doHandlePageException(PageCont
extI
> > mpl.java:848)
> >
> >
>
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContex
tImp
> > l.java:781)
> >
> >
>
org.apache.jsp.view.unmatchedPayments_jsp._jspService(org.apache.jsp.vie
w.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(JspServletWrapper.ja
va: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(ReplyHeaderFilte
r.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.doHandlePageException(PageCont
extI
> > > mpl.java:848)
> > >
> > >
> >
>
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContex
tImp
> > > l.java:781)
> > >
> > >
> >
>
org.apache.jsp.view.unmatchedPayments_jsp._jspService(org.apache.jsp.vie
w.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.ja
va: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(ReplyHeaderFilte
r.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]
> >
> >
> 
> ---------------------------------------------------------------------
> 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]
> 
>

---------------------------------------------------------------------
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]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to