tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marco Mistroni <mmistr...@gmail.com>
Subject Re: Still Struggling with JSTL and c:forEach :-(
Date Sat, 18 Jun 2005 13:45:08 GMT
hello all,
  thanx a lot Rahul, it was a typo.....

regards
 marco

On 6/17/05, Marco Mistroni <mmistroni@gmail.com> wrote:
> Hello,
>   sorry....well i have code @home so i'll have to get back later
> today or tomorrow
> i have stored in ServletContext a  List of ExpenseType objects under
> the name 'EXPENSE_TYPES'
> 
> I can retrieve it successfully (i did a dummy print whithin c:forEAch
> and it printed correctly 11 lines (which is the number of elements in
> the list).
> 
> Wendy, if i write
> <c:out value="${expense}"/>  the String representation of my object
> gets printed, which is
> <id=1  description=foobar/>
> 
> before i was using a Struts tag for retrieving EXPENSE_TYPES attribute
> and it was working fine...
> 
> i'll try what Wendy suggested
> 
> <c:out value="${applicationScope.EXPENSE_TYPES}" />
> 
> and get back to you all..
> 
> thanx and regards for your help
> 
> marco
> 
> On 6/16/05, Wendy Smoak <java@wendysmoak.com> wrote:
> > From: "Marco Mistroni" <mmistroni@gmail.com>
> > > <c:forEach var="expense" items="${applicationScope.EXPENSE_TYPES}>" >
> > >       <c:out value="${expense.description}"/><br/>
> > > </c:forEach>
> > >
> > > ServletException in '/insertBody.jsp': An error occurred while evaluating
> > > custom action attribute "value" with value "${expense.description}":
> > > Unable to find a value for "description" in object of
> > > class "java.lang.String" using operator "." (null)
> >
> > What does <c:out value="${applicationScope.EXPENSE_TYPES}" /> print?
> >
> > Try it with just <c:out value="${expense}"/> in the middle.  What do you
> > get?
> >
> > For some reason, 'expense' is a String.  Maybe your List doesn't contain
> > what you think it does.
> >
> > --
> > Wendy Smoak
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
> >
> >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Mime
View raw message