That's great! But how about the other way? Can I post an array in velcity
up to a struts form ( via a controller ) which contains an array?

_______________________
Will Spies
Towers Perrin
Phone: (215)246-7145
e-mail: [EMAIL PROTECTED]


                                                                                       
                            
                                                                                       
                            
                                         To:     Struts Users Mailing List 
<[EMAIL PROTECTED]>        
                    Gabriel Sidler       cc:     (bcc: Will Spies/Towers Perrin)       
                            
                    <sidler@teamup       Subject:     Re: Velocity-Tools / Struts      
                            
                    .ch>                                                               
                            
                                                                                       
                            
                    01/21/02 04:37                                                     
                            
                    PM                                                                 
                            
                    Please respond                                                     
                            
                    to "Struts                                                         
                            
                    Users Mailing                                                      
                            
                    List"                                                              
                            
                                                                                       
                            
                                                                                       
                            




Will Spies/Towers Perrin wrote:
>
> It would be real helpful if this example include posting an array. Is
this
> even doable with velstruts?
>

You mean like creating HTML output from the content of an array?

That's quite simple. Assuming you have a 'user' object with 'orders'
associated
with the session, the template might look like this:

<table>
#foreach ($order in $session.user.orders)
  <tr>
    <td>$order.nbr</td>
    <td>$order.text</td>
    <td>$order.amount</td>
  </tr>
#end
</table>

...would create a table of all orders. Were are going to add more doc and
examples. For now you find more info on the Velocity home page at
jakarta.apache.org/velocity/

Gabe


> _______________________
> Will Spies
> Towers Perrin
> Phone: (215)246-7145
> e-mail: [EMAIL PROTECTED]
>
>
>
>                                          To:
[EMAIL PROTECTED]
>                     Ted Husted           cc:     (bcc: Will Spies/Towers
Perrin)
>                     <husted@apache       Subject:     Velocity-Tools /
Struts
>                     .org>
>
>                     01/18/02 09:46
>                     AM
>                     Please respond
>                     to "Struts
>                     Users Mailing
>                     List"
>
>
>
> Will Spies/Towers Perrin wrote:
> > >>And Velocity can access the Struts controller too :)
> >
> > is this documented anywhere? Is this just in development now or is it
> part
> > of their release?
>
> It hasn't made it into the release yet, but the code is already working
> and seems mature. It's just a matter of making the Struts elements
> available as standard objects that Velocity can see.
>
> Really ~very~ cool. You can download the sample application WAR here.
> Very much worth a look.
>
> http://husted.com/struts/resources/velstruts.zip
>
> I'll be working on adding more documentation for this, and other
> contributions like the Commons-Validator and Tiles to the Struts User
> Guide.
>
> -- Ted Husted, Husted dot Com, Fairport NY USA.
> -- Building Java web applications with Struts.
> -- Tel +1 585 737-3463.
> -- Web http://www.husted.com/struts/
>
> --
> To unsubscribe, e-mail:   <
> mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <
> mailto:[EMAIL PROTECTED]>
>
> --
> To unsubscribe, e-mail:   <
mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <
mailto:[EMAIL PROTECTED]>

--
Gabriel Sidler
Software Engineer, Eivycom GmbH, Zurich, Switzerland

--
To unsubscribe, e-mail:   <
mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <
mailto:[EMAIL PROTECTED]>






--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to