This week's giveaway is in the Programmer Certification (OCPJP) forum.
We're giving away four copies of Java Mock Exams (software) and have David Mayer on-line!
See this thread for details.
Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How would i obtain a value from logic: iter.. and pass to scriplet

 
john mattucci
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Im iterating through a collection and I was wondering how I would obtain a value from a and pass it to xxx. A is an object which has a field named date which holds a Date value.

<logic:iterate id="a" name="bb" >

<% StringBuffer d = new SimpleDateFormat("MMMM d, yyyy").format( xxx , new StringBuffer(), new FieldPosition(0) );
%>

thank you all
[ February 16, 2005: Message edited by: john mattucci ]
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Replace xxx with a.

It's really that simple. You might have to specify logic:iterate's type attribute to say what kind of object a is but that's all.
 
john mattucci
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
date is an element in class a , so would i be able to pass a.date to xxx
[ February 16, 2005: Message edited by: john mattucci ]
 
john mattucci
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
u were right u need the type attribute
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!