struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pat Quinn" <pat_quinn2...@hotmail.com>
Subject Re: Map-backed ActionForms
Date Wed, 11 Dec 2002 14:59:22 GMT
You access your form bean in the very same way as before theres nothing new 
there.






>From: Mark <marklowe@libero.it>
>Reply-To: melowe@mac.com
>To: Struts Users Mailing List <struts-user@jakarta.apache.org>
>Subject: Re: Map-backed ActionForms
>Date: Wed, 11 Dec 2002 15:54:36 +0100
>
>Pat
>
>How do i get to my FormBean in my action class
>
>usually:
>
>MyForm theForm = (MyForm) form;
>
>But when i try to compile javac says 'no', is there something i'm missing 
>or
>does javac hate me :)?
>
>
>On 11-12-2002 14:49, "Pat Quinn" <pat_quinn2009@hotmail.com> wrote:
>
> > I'm using the Map-Backed action form approach as detailed here:
> >
> > 
>http://jakarta.apache.org/struts/userGuide/building_controller.html#map_action
> > _form_classes
> >
> > I have a form bean with a one instance of a Value 
>Object(i.e.customersVO),
> > this value object contain an ArrayList(i.e. CustomerDetails) of other 
>Value
> > objects(i.e. CustomerDetailsVO).
> >
> > ----------
> > Form Bean
> > ----------
> > public class customersForm extends ActionForm {
> >
> >
> >   private customersVO customers = null;
> >
> >
> >   /*Get & Set methods for the customers Value Object*/
> >   public void setCustomers(customersVO pCustomersVO ) {
> >       customers = pCustomersVO;
> >   }
> >
> >
> >   public customersVO getCustomers() {
> >       return customers;
> >   }
> >
> >
> >   /*Get & Set methods for the ArrayList of VO's contained within the
> > customersVO*/
> >   public Object getCustomerDetail(int key) {
> >       return customers.getCustomerDetails().get(key);
> >   }
> >
> >   public void setCustomerDetail(int key, Object value) {
> >          customers.getCustomerDetails().set(key, value);
> >   }
> > }
> >
> >
> > -----------
> > JSP Source
> > -----------
> > <logic:iterate name="myForm"  property="CustomerDetails" 
>indexId="rowIndex">
> > <% String name = "customerDetail["+rowIndex+"]";%>
> > <html:text property="<%=name + ".firstName"%>"/>
> >
> >
> >
> > This works fine but i personally don't like including scriplet code like
> > this in my jsp's. Is there another way can do this??
> >
> >
> >
> >
> >
> >
> > _________________________________________________________________
> > Add photos to your e-mail with MSN 8. Get 2 months FREE*.
> > http://join.msn.com/?page=features/featuredemail
> >
> >
> > --
> > To unsubscribe, e-mail:   
><mailto:struts-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail: 
><mailto:struts-user-help@jakarta.apache.org>
> >
> >
>
>
>--
>To unsubscribe, e-mail:   
><mailto:struts-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: 
><mailto:struts-user-help@jakarta.apache.org>


_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message