Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > questions about struts

Reply
Thread Tools

questions about struts

 
 
sunny liu
Guest
Posts: n/a
 
      10-21-2004
I'm new to struts, Do I have to create one ActionForm for each action?
If there are three buttons on one page?
 
Reply With Quote
 
 
 
 
Oscar kind
Guest
Posts: n/a
 
      10-21-2004
sunny liu <(E-Mail Removed)> wrote:
> I'm new to struts, Do I have to create one ActionForm for each action?
> If there are three buttons on one page?


No. Generally it's one ActionForm per JSP page (to match the form fields).

The number of actions depends on your design:
- One Action per JSP page that handles all actions from that page.
Easy structure to work with, but it's also easy to make one Action do
several things (not clean OO IMHO, as one object should have one
purpose).
- One action per business action.
Easy to understand, but muddles the separation between model and
controller (according to the docs, Action's are part of the controller).
- One Action overall that passes all actions to the business model.
Easy to work with, but it's dangerous: you must be really sure all input
is checked, as you pass it directly into the business layer.


--
Oscar Kind http://home.hccnet.nl/okind/
Software Developer for contact information, see website

PGP Key fingerprint: 91F3 6C72 F465 5E98 C246 61D9 2C32 8E24 097B B4E2
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it safe to point to Internet for locating struts DTD files in struts TLDs and XML files? Katie Wright Java 8 01-07-2005 03:37 PM
[Struts] Newbie - For ActionForm population, must I use Struts taglib? Pratap Das Java 2 04-05-2004 07:42 PM
[Struts]output javascript in struts perform() sin Java 3 02-22-2004 08:27 AM
Integrate a Struts app with a non-struts app jc1771 Java 0 12-28-2003 06:36 PM
Struts Installation - missing struts.tld??? Jason Us Java 0 10-03-2003 11:36 PM



Advertisments