You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jin Bal <ji...@hotmail.com> on 2002/09/24 09:16:06 UTC

Re: [ActionForm] Extending existing ActionForm classes

CreateUserProfileForm etc must extend from ActionForm then
UpdateUserProfileForm can extend from CreateUserProfileForm.

Your forms must have a base type of ActionForm

HTH

Jin

----- Original Message -----
From: "Charles" <ch...@radworkz.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Tuesday, September 24, 2002 7:16 PM
Subject: [ActionForm] Extending existing ActionForm classes


> Hi,
> I got question about new actionform classes extending existing actionform
> classes. For example, I have this CreateUserProfileForm that has all the
> fields for User Profiles, which I would like to use them in my new form
> UpdateUserProfileForm. Is it possible that the UpdateUserProfileForm
extend
> from the existing CreateUserProfileForm (so that I can reuse all the
> existing attributes of that class)  instead of extending from ActionForm?
> I've tried that and when I start up my application I get a
> UnavailableException thrown by the ActionServlet. but when I replace the
> "extend CreateUserProfileForm" back to "extend ActionForm" everything
worked
> fine. Could someone help me out ? Thanks.
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: [ActionForm] Extending existing ActionForm classes

Posted by Robert Taylor <rt...@mulework.com>.
Charles, I'm not sure why your inheritence chain wouldn't work if your
CreateUserProfileForm extends ActionForm and UpdateUserProfileForm extends
CreateUserProfileForm. You may want to take 5 minutes and create a test
scenario; create AForm which extends from ActionForm and create BForm and
which extends AForm. Don't add any getters or setters or additional code.
Defined them in your struts-config.xml file and then see what happens.


What about using the same form for both updating and creating user profiles.
Your create page will just not use all the form fields. Now if you are not
using StrutsValidator and you have hard coded validation for each form, then
it may be cleaner to stick with the two separate forms.

When you get a few extra cycles, you may want to look into using
StrutsValidator, DynaValidatorActionForm, and DynaBeans. It is well worth
the time invested.

robert
> -----Original Message-----
> From: Charles [mailto:charles@radworkz.com]
> Sent: Tuesday, September 24, 2002 6:59 PM
> To: Struts Users Mailing List
> Subject: Re: [ActionForm] Extending existing ActionForm classes
>
>
> Yup my CreateUserProfileForm does extend from ActionForm, but I still get
> the exception. Have you tried something like this before? It would help me
> alot to know that this is something possible and can be done :)
>
>
>
> ----- Original Message -----
> From: "Jin Bal" <ji...@hotmail.com>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Tuesday, September 24, 2002 12:16 AM
> Subject: Re: [ActionForm] Extending existing ActionForm classes
>
>
> > CreateUserProfileForm etc must extend from ActionForm then
> > UpdateUserProfileForm can extend from CreateUserProfileForm.
> >
> > Your forms must have a base type of ActionForm
> >
> > HTH
> >
> > Jin
> >
> > ----- Original Message -----
> > From: "Charles" <ch...@radworkz.com>
> > To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> > Sent: Tuesday, September 24, 2002 7:16 PM
> > Subject: [ActionForm] Extending existing ActionForm classes
> >
> >
> > > Hi,
> > > I got question about new actionform classes extending existing
> actionform
> > > classes. For example, I have this CreateUserProfileForm that
> has all the
> > > fields for User Profiles, which I would like to use them in
> my new form
> > > UpdateUserProfileForm. Is it possible that the UpdateUserProfileForm
> > extend
> > > from the existing CreateUserProfileForm (so that I can reuse all the
> > > existing attributes of that class)  instead of extending from
> ActionForm?
> > > I've tried that and when I start up my application I get a
> > > UnavailableException thrown by the ActionServlet. but when I
> replace the
> > > "extend CreateUserProfileForm" back to "extend ActionForm" everything
> > worked
> > > fine. Could someone help me out ? Thanks.
> > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> > > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> > >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> >
> >
> >
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [ActionForm] Extending existing ActionForm classes

Posted by Charles <ch...@radworkz.com>.
Yup my CreateUserProfileForm does extend from ActionForm, but I still get
the exception. Have you tried something like this before? It would help me
alot to know that this is something possible and can be done :)



----- Original Message -----
From: "Jin Bal" <ji...@hotmail.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Tuesday, September 24, 2002 12:16 AM
Subject: Re: [ActionForm] Extending existing ActionForm classes


> CreateUserProfileForm etc must extend from ActionForm then
> UpdateUserProfileForm can extend from CreateUserProfileForm.
>
> Your forms must have a base type of ActionForm
>
> HTH
>
> Jin
>
> ----- Original Message -----
> From: "Charles" <ch...@radworkz.com>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Tuesday, September 24, 2002 7:16 PM
> Subject: [ActionForm] Extending existing ActionForm classes
>
>
> > Hi,
> > I got question about new actionform classes extending existing
actionform
> > classes. For example, I have this CreateUserProfileForm that has all the
> > fields for User Profiles, which I would like to use them in my new form
> > UpdateUserProfileForm. Is it possible that the UpdateUserProfileForm
> extend
> > from the existing CreateUserProfileForm (so that I can reuse all the
> > existing attributes of that class)  instead of extending from
ActionForm?
> > I've tried that and when I start up my application I get a
> > UnavailableException thrown by the ActionServlet. but when I replace the
> > "extend CreateUserProfileForm" back to "extend ActionForm" everything
> worked
> > fine. Could someone help me out ? Thanks.
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> >
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>