Yes. WebMacro can iterate any of the following:

   -- any kind of array
   -- iterators and enumerations
   -- anything with an elements() or iterator() method that returns
      an Enumeration or Iterator

The #foreach will analyze your object to see if any of those approaches
work, and if so, you can iterate through the set.

It's that third case that allows vectors and other collection types
to be used in a loop.

   WebMacro Servlet Framework
   http://webmacro.org

Justin


Quoting Ray Tayek ([EMAIL PROTECTED]):
> At 02:10 PM 5/20/99 -0400, you wrote:
> >If you are using a good template system, it will akkow you to build
> >the table in the template. With WebMacro:
> >
> >     <table>
> >     <tr><td><b>Item</b></td><td><b>Cost</b></td></tr>
> >     #foreach $product in $inventory {
> >        <tr><td>$product.name</td><td>$product.cost</td</tr>
> >     }
> >     </table>
> >
> >where you've done something like this in the servlet:
> >
> >     Vector productList = ...;
> >     templateContext.put("inventory:, productList);
> >
>
> i thought webmacro only worked on arrays of objects. do vectors and lists
> work also?
>
> thanks
>
> Ray (will hack java for food) http://home.pacbell.net/rtayek/
> hate Spam? http://www.blighty.com/products/spade/
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to