Thanks for the prompt reply Dave. I have a couple of follow-up questions
regarding this.

On Wed, 2011-04-27 at 08:59 -0400, Dave Newton wrote:

> It's not making a separate *browser* request, it's all internal to S2.
> 

Does this mean that struts' FAQ in
https://cwiki.apache.org/WW/how-do-we-repopulate-controls-when-validation-fails.html
 is incorrect in suggesting s:action for this?


> Personally, I think things like this are better handled through
> Preparable or similar mechanism.
> 

I haven't used the Preparable approach much, mainly because my actions
are usually grouped by domain objects. Eg: I'll have a PersonAction
where  I'll put a add, list, remove methods which I'll map actions to.
This saves a bit of configuration in things like adding the
corresponding service (personService) and setter. With a preparable I'll
have:

1) unused logic (say, if I have a findPerson() method/action, it won't
probably need a list = personService.getAll() that I'll put in my
preparable method. So an extra db call

2) funny looking empty actions (eg: the list() method/action will now be
an empty return "something", because the logic is in the preparable.
Isn't this odd-looking?


That said, I don't use validation very often. It appears to over
complicate things a bit (a bit egg vs chicken theory, perhaps that's why
I don't use it very often).

Regards,

Miguel

Reply via email to