You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Bryan Field-Elliot <br...@netmeme.org> on 2001/04/05 16:41:37 UTC

Edit form -- comments

Hmm I didn't catch that nuance... thanks for pointing that out, it does 
indeed change the picture.

In any case, I finally got my own application to work as intended --  
using one JSP page, one ActionForm, and one Action --

1. The JSP page's initial invocation notices that there is no ActionForm 
bean present, so it forwards to user to the Action (with no parameters).
2. The Action (which is configured with "validate=false") notices that 
the ActionForm supplied is EMPTY (note that it's not NULL), and fills it 
with the editable data, then forwards the user back to the JSP page.
3. The JSP page displays the form in HTML format, and changes are 
submitted back to the Action again.
4. The Action notices that we have a "full form" now, so it MANUALLY 
calls the ActionForm's "validate()" method. Then, assuming there are no 
ActionErrors, it saves the data to disk.

Would appreciate comments from the group on whether this is a reasonable 
design use of Struts.

Thanks,

Bryan

P.S. To Biju Isac -- I do not think that Struts is wrong from every 
angle; in fact I'm wrapping up a three-month project based upon it, and 
in reflecting on the experience there's a lot to like about Struts. On 
the other hand, I do think that the documentation needs a lot of beefing 
up. I will also share my feelings that the tag library, in particular, 
is confusingly designed. For example, many of the [logic] tags seem to 
have too many permuations of behavior depending upon the parameters 
supplied. I'm just not convinced that such deeply intertwined, 
"overloaded" behavior (for lack of a better description) is the best 
design. It certainly makes it hard to wade through the docs and grasp 
(and memorize) how they work.

Jean-Noel Ribette wrote:

> 
> registration.jsp does display the populated form, but when the form is submited, it is to SaveRegistrationAction, not
> EditRegistrationAction.
> 
> Jean-Noel
> 
> 
>