Marco Tedone wrote:

Well, as far as I can see, a part from the validation bit, the use would be
pretty much the same:

with action forms, to retrieve values, I'd have to invoke a getter method on
the action form, while with straight HTML I'd invoke the get on the request.

The downside, as far as I can see, is that I'd have to declare a new class
for any new form. Are there any other advantages from using ActionForms?

Marco

----- Original Message ----- From: "Amleto Di Salle" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Tuesday, September 07, 2004 3:09 PM
Subject: R: A couple of questions



Hi, the ActionForm are used for the input form of your application. If you use the ActionForm in your Action you don't have to use the HttpServletRequest.getParameter("ID") method in order to obtain the value of the parameter "ID", for example. Furthermore, using ActionForm with package Validator you can validate your forms in the client and server side.

What's new in Struts 1.2.2
http://struts.apache.org/userGuide/release-notes.html

But the 1.2.2 has some problems. So in your case you can use the Struts
1.1




There are many. First, when you use an ActionForm you can mine the values of request parameters from multiple requests. So, while you seem to be doing the same thing with [ActionForm].getParameter() as with request.getParameter("parameter") you definitely are NOT. You are in fact abstracting the request.getParameter("parameter") method call so that you don't have to keep repeating it, i.e. you get rid of unnecessary, repetitive, coding. Second, if there are validations issues, as you have seen, they are also abstracted. Third, you get a whole panoply of tags which are tied to the ActionForm and allow simplified work with page design. There is no limit to how you can extend this. My company, for example, uses this to provide completely automatic generation of submit and image tags making the cost of tag designers essentially a moot issue by extending the submit and image html tags connected to the form. Fourth, you get to set the form on the page in relation to your model with an ease that is a bit surprising. This is a poplular framework because it definitely is a good design. Craig did one hell of a job on this.

Michael



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to