Thomas Menke <stripe...@...> writes: > I do like the "Action first" model and I placed all my JSP files in the > WEB-INF directory to make them unavailable for direct calls. But I do > have more than one action bean. In this case there are two action beans > involved: The FormActionBean and the SaveActionBean. The FormActionBean > loads an entity from the database if an id has been supplied (to > prepopulate the form) and just displays the form. But the form does not > submit to the FormActionBean. Instead the data is send to the > SaveActionBean (<stripes:form beanclass="...SaveActionBean">...). > I did this because at some point I got a little confused within my own > code with all the @Validate(on={"foo","bar","foobar"}). To get rid of > all the variable declarations that I don't need in certain methods I > started putting every method in a separate action bean. Unfortunately I > discovered that this breaks the automatic population of the form. > Would you consider that bad practice what I am doing and advise me to > always put the method that displays the form into the same ActionBean as > the method that is executed on submit?
Hi Thomas -- I personally think this /is/ a bad practice. The first obvious reason is that, as you've found, it breaks automatic form population. The second is that you have a level of simplicity maintained in Stripes by keeping a one-to-one relationship between an action bean and the JSP. I've found this to be great when developing because it simplifies development and debugging significantly. You FormActionBean corresponds to form.jsp, and you know that whenever you do something in form.jsp, it always goes to FormActionBean; from there you have an option to resolve to another JSP. ------------------------------------------------------------------------------ ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo _______________________________________________ Stripes-users mailing list Stripes-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/stripes-users