File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes How would i obtain a value from logic: iter.. and pass to scriplet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How would i obtain a value from logic: iter.. and pass to scriplet" Watch "How would i obtain a value from logic: iter.. and pass to scriplet" New topic
Author

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

john mattucci
Ranch Hand

Joined: Nov 03, 2000
Posts: 331
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

Joined: Feb 05, 2003
Posts: 4727

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.


A good workman is known by his tools.
john mattucci
Ranch Hand

Joined: Nov 03, 2000
Posts: 331
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

Joined: Nov 03, 2000
Posts: 331
u were right u need the type attribute
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How would i obtain a value from logic: iter.. and pass to scriplet
 
Similar Threads
Issue in using the DatabaseServerLoginModule for encrypting the password using MD5
how to encrypt the text
Axis 1.4 throwing org.xml.sax.SAXException: Invalid element
form element -- objeect null
Passing multiple listbox to bean using JSP