I am using the 1.1beta version(beta1 I guess, are there any changes between
beta1 and 2 on this?)

Now, I have been doing a little research myself.  And I have found a
paragraph on http://jakarta.apache.org/struts/userGuide/building_model.html:

"Think, for example, of the wizard style user interface that is commonly
used when installing new applications. Struts encourages you to define a
single ActionForm bean that contains properties for all of the fields, no
matter which page the field is actually displayed on. Likewise, the various
pages of the same form should all be submitted to the same Action Class. If
you follow these suggestions, the page designers can rearrange the fields
among the various pages, often without requiring changes to the processing
logic. "

Looks like it is telling people do use the same action as well.  Am I
reading this correctly?  If I use the same action for these different html
pages, I then have to find out how many form values I have for the
redirection.  For example, if I don't have userinfo yet, redirect to
userinfo page.  That is not very elegant, can anyone agree?

-- Derek

----- Original Message -----
From: "James Mitchell" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Sunday, October 27, 2002 9:26 PM
Subject: RE: Problem with multiple html(jsp) pages sharing one form
(actionform)


> You would only need hidden fields if you were using request scope for this
> wizard.
>
> From looking at what you've provided, it appears that it should work just
> fine.
>
> What release or build of struts are you using?
>
> BTW, you can remove 'dynamic="true"', as it is no longer required.
>
>
>
> James Mitchell
> Software Engineer/Struts Evangelist
> http://www.open-tools.org
>
> "Only two things are infinite, the universe and human stupidity, and I'm
not
> sure about the former."
> - Albert Einstein (1879-1955)
>
>
> > -----Original Message-----
> > From: Derek Lin [mailto:dereklin@;hotmail.com]
> > Sent: Monday, October 28, 2002 12:16 AM
> > To: Struts Users Mailing List
> > Subject: Re: Problem with multiple html(jsp) pages sharing one form
> > (actionform)
> >
> >
> > I am using the org.apache.struts.validator.DynaValidatorForm.
> > You mean the
> > reset method is called every time an action is invoked?  If that
> > is true.  I
> > would have to extend the DynaValidatorForm to write my own actionform,
> > correct?
> >
> > -- Derek
> >
> >
> > ----- Original Message -----
> > From: "David Graham" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Sunday, October 27, 2002 8:10 PM
> > Subject: Re: Problem with multiple html(jsp) pages sharing one form
> > (actionform)
> >
> >
> > > Your values might be getting reset by your reset method.
> > >
> > > David
> > >
> > >
> > > >From: "Derek Lin" <[EMAIL PROTECTED]>
> > > >Reply-To: "Struts Users Mailing List"
<[EMAIL PROTECTED]>
> > > >To: <[EMAIL PROTECTED]>
> > > >Subject: Problem with multiple html(jsp) pages sharing one form
> > > >(actionform)
> > > >Date: Sun, 27 Oct 2002 18:57:17 -0800
> > > >
> > > >I find this paragraph from the "programming struts" book:
> > > >"You don't have to declare an ActionForm for every HTML form in your
> > > >application.  The same ActionForm can be associated with one or more
> > action
> > > >mappings. This means that they can be shared across multiple
> > HTML forms.
> > > >For example, if you had a wizard interface, where a set of data was
> > entered
> > > >and posted across multiple pages, a single ActionForm can be used to
> > > >capture all of this data, a few fields at a time."
> > > >
> > > >So I tried to implement similar pages.
> > > >Here is the form:
> > > >         <form-bean
> > > >             name="RegistrationForm"
> > > >       dynamic="true"
> > > >             type="org.apache.struts.validator.DynaValidatorForm">
> > > >           <form-property name="userRole" type="java.lang.String"/>
> > > >           <form-property name="firstName" type="java.lang.String"/>
> > > >           <form-property name="lastName" type="java.lang.String"/>
> > > >           <form-property name="companyName"
type="java.lang.String"/>
> > > >           <form-property name="companyAddressType"
> > > >type="java.lang.String"/>
> > > >           <form-property name="companyStreet"
> > type="java.lang.String"/>
> > > >           <form-property name="companyStreet2"
> > type="java.lang.String"/>
> > > >           <form-property name="companyCity"
type="java.lang.String"/>
> > > >           <form-property name="companyState"
type="java.lang.String"/>
> > > >           <form-property name="companyProvince"
> > type="java.lang.String"/>
> > > >           <form-property name="companyZip" type="java.lang.String"/>
> > > >           <form-property name="companyCountry"
> > type="java.lang.String"/>
> > > >           <form-property name="companyPhone"
type="java.lang.String"/>
> > > >           <form-property name="companyPhoneType"
> > type="java.lang.String"/>
> > > >           <form-property name="companyFax" type="java.lang.String"/>
> > > >           <form-property name="companyEmail"
type="java.lang.String"/>
> > > >           <form-property name="companyEmailType"
> > type="java.lang.String"/>
> > > >          <form-property name="companyPassword"
> > type="java.lang.String"/>
> > > >      <form-property name="companyPassword2"
type="java.lang.String"/>
> > > >           <form-property name="companyUsername"
> > type="java.lang.String"/>
> > > >           <form-property name="creditcardType"
> > type="java.lang.String"/>
> > > >           <form-property name="creditcardNumber"
> > type="java.lang.String"/>
> > > >           <form-property name="creditcardExpDate"
> > > >type="java.lang.String"/>
> > > >           <form-property name="userPhone" type="java.lang.String"/>
> > > >           <form-property name="userPhoneType"
> > type="java.lang.String"/>
> > > >           <form-property name="userFax" type="java.lang.String"/>
> > > >           <form-property name="userEmail" type="java.lang.String"/>
> > > >           <form-property name="userEmailType"
> > type="java.lang.String"/>
> > > >     </form-bean>
> > > >
> > > >Here are my actions mapping:
> > > >         <action
> > > >           path="/registration-user"
> > > >           input="/registration/company.jsp"
> > > >           name="RegistrationForm"
> > > >           parameter="/registration/user.jsp"
> > > >           scope="session"
> > > >           type="org.apache.struts.actions.ForwardAction"
> > > >           validate="true"/>
> > > >         <action
> > > >           path="/registration-creditcard"
> > > >           input="/registration/user.jsp"
> > > >           name="RegistrationForm"
> > > >           parameter="/registration/creditcard.jsp"
> > > >           scope="session"
> > > >           type="org.apache.struts.actions.ForwardAction"
> > > >           validate="true"/>
> > > >         <action
> > > >             path="/registration-company-all"
> > > >
> > type="com.futurecargo.framework.actions.EJBRegistrationAction"
> > > >             name="RegistrationForm"
> > > >             scope="session"
> > > >             validate="true"
> > > >             input="/registration/creditcard.jsp">
> > > >      <forward name="success" path="/registration/success.jsp" />
> > > >      <forward name="failure" path="/index.jsp" />
> > > >     </action>
> > > >
> > > >The problem is that the form values are not being carried over.  (I
am
> > > >thinking if I need to use hidden values on my subsequent html pages).
> > Has
> > > >anyone successfully implemented something like this?  Please help.
> > > >
> > > >Thanks,
> > > >
> > > >Derek
> > > >
> > > >
>
>
> --
> 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>

Reply via email to