In my project, I am getting the data from database and keeping it in the proporties with name values pair and setting that in pricingWorksheetForm.setProductTree((TreeMap)getServlet().getServletContext().getAttribute("productTree"));
The <logic:iterate /> tag is used to iterate over a named collection�which contains a Collection, Enumerator,Iterator, Map, or Array�and evaluates its body for each Object in the collection. The id attribut specifies a JSP scripting variable, exposed by the <logic: iterate /> tag, that will hold the current object in the named collection.This attribute is mandatory. The name attribute specifies a scripting variable that represents the collection to be iterated over. This attribute is optional. The property attribute specifies the data member of the scripting variable, identified by the name attribute, that contains a reference to a collection. This is also optional. The type attribute provides the fully qualified class name of the element being exposed from the collection. This object is referenced by the id attribute. This is also optional.
The <bean:define /> tag is used to retrieve the value of a named bean property and define it as a scripting variable, which will be stored in the scope specified by the toScope attribute. The id attribute of <bean:define> specifies the scripting variable that will be created and stored in a scoped attribute that will be made available with the value of the indicated property. This is mandatory attribute. The name attribute specifies the attribute name of the bean whose property is retrieved to define a new scoped attribute. This attribute is optional. The property attribute identifies the property of the bean, specified by the name attribute, that is being retrieved. This is also optional. Lastly, the type attribute provides the fully qualified class name of the value to be exposed as the id attribute.
Assuming that you have appropriate getters&setters in your formmbean.
Here we have a we have a collection(TreeMap) called "productTree" ( probably set in session as it seems to be a formbean variable)
The logic iterate tag defines a jsp scripting variable as "prodTree" and this will contain the current object of the collection "productTree". Now the bean define tag takes the object and gets the "product" variable and finally we have a scripplet that displays some property of productTree.