You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Matthew J. Vincent" <vi...@cs.usm.maine.edu> on 2004/08/11 04:51:16 UTC

Should every Action have an associated form?

Hey everyone!

I hope to not get flamed, but it's getting late here and I'm tired of 
looking through the archives.  Should every Action have an associated 
ActionForm?  Is it a bad idea to read a parameter directly from the 
request in the Action?  I have a page where I need to show details for a 
particular item in our database.  People will be directed to this page 
via a url http://127.0.0.1/foo/bar.do?id=123.  If I need an ActonForm, 
what's the best way to set this up in the struts-config.xml?  Thoughts?

Thanks in advance!

Matt

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


Re: Should every Action have an associated form?

Posted by "Matthew J. Vincent" <vi...@cs.usm.maine.edu>.
Thanks everyone!  Much appreciated.

Matt


Michael McGrady wrote:

> I have lots of actions without forms.  They are useful when you don't 
> have forms.  LOL  Seriously, that is the reason.
>
> Michael
>
> At 07:51 PM 8/10/2004, you wrote:
>
>> Hey everyone!
>>
>> I hope to not get flamed, but it's getting late here and I'm tired of 
>> looking through the archives.  Should every Action have an associated 
>> ActionForm?  Is it a bad idea to read a parameter directly from the 
>> request in the Action?  I have a page where I need to show details 
>> for a particular item in our database.  People will be directed to 
>> this page via a url http://127.0.0.1/foo/bar.do?id=123.  If I need an 
>> ActonForm, what's the best way to set this up in the 
>> struts-config.xml?  Thoughts?
>>
>> Thanks in advance!
>>
>> Matt
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>


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


Re: Should every Action have an associated form?

Posted by Michael McGrady <mi...@michaelmcgrady.com>.
I have lots of actions without forms.  They are useful when you don't have 
forms.  LOL  Seriously, that is the reason.

Michael

At 07:51 PM 8/10/2004, you wrote:
>Hey everyone!
>
>I hope to not get flamed, but it's getting late here and I'm tired of 
>looking through the archives.  Should every Action have an associated 
>ActionForm?  Is it a bad idea to read a parameter directly from the 
>request in the Action?  I have a page where I need to show details for a 
>particular item in our database.  People will be directed to this page via 
>a url http://127.0.0.1/foo/bar.do?id=123.  If I need an ActonForm, what's 
>the best way to set this up in the struts-config.xml?  Thoughts?
>
>Thanks in advance!
>
>Matt
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>



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


Re: Should every Action have an associated form?

Posted by Craig McClanahan <cr...@gmail.com>.
On Tue, 10 Aug 2004 22:00:08 -0500, Vic Cekvenich
<ce...@portalvu.com> wrote:
> Matthew J. Vincent wrote:
> > Hey everyone!
> >
> > I hope to not get flamed, but it's getting late here and I'm tired of
> > looking through the archives.  Should every Action have an associated
> > ActionForm?  

> No. Only updateable actions need a formbean.

I would add to that cases where you want the request parameters to be
validated.  Then, it's most likely simpler to use the ActionForm
machinery.

Craig

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


Re: Should every Action have an associated form?

Posted by Vic Cekvenich <ce...@portalvu.com>.
Matthew J. Vincent wrote:
> Hey everyone!
> 
> I hope to not get flamed, but it's getting late here and I'm tired of 
> looking through the archives.  Should every Action have an associated 
> ActionForm?  
No. Only updateable actions need a formbean.

Is it a bad idea to read a parameter directly from the
> request in the Action? 

No.

  I have a page where I need to show details for a
> particular item in our database.  People will be directed to this page 
> via a url http://127.0.0.1/foo/bar.do?id=123. 
  If I need an ActonForm,
> what's the best way to set this up in the struts-config.xml?  Thoughts?

You don't need an action form.
in action get the parm id, create a pojo bean and put in scope.
(if you need to edit that, then you need a form bean, and you need to 
get a handle on to that bean)
.V
> 
> Thanks in advance!
> 
> Matt


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