Problem with iterating a list of Java objects
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   HELIGON_Sandra
Posted On:   Wednesday, May 29, 2002 06:21 AM

I have the following interfaces objects public interface Land(){ // Get a list of materials PersistentList Regions(); } public interface PersistentList // Give the list of cities Object[] Cities(); } with object type: public interface Object. My question is how to display the list of cities with the list of regions for each city without use an ActionForm. Do I must create JavaBeans based on interface with collection property ? I did not understand what kind of type the tag Logic:iterate allows (vector ? list ? collection ?). Do i must use the nested tag extension ? If someone has a complete example wit   More>>

I have the following interfaces objects

public interface Land(){
// Get a list of materials
PersistentList Regions();
}

public interface PersistentList
// Give the list of cities
Object[] Cities();
}

with object type: public interface Object.

My question is how to display the list of cities with
the list of regions for each city without use an ActionForm.
Do I must create JavaBeans based on interface
with collection property ?

I did not understand what kind of type the tag
Logic:iterate allows (vector ? list ? collection ?).
Do i must use the nested tag extension ?

If someone has a complete example with JavaBean classes
definition and JSP (logic tag) code, could you e-mail me
please.

Thanks a lot in advance.

   <<Less

Re: Problem with iterating a list of Java objects

Posted By:   Venky_Krishna  
Posted On:   Tuesday, June 11, 2002 06:34 AM

You have to create an interface that returns a collection. A collection includes a vector, list and arrays. So if you return an object array, that would be valid for the iterate tag to work with.


If we desired to display all the cities, we would code the following in the jsp page















List Of Cities



Thanks, Venky

About | Sitemap | Contact