On Sunday, August 3, 2003, at 06:02 PM, David Graham wrote:
Not everyone uses the terms "success" and "failure" in their apps and
hardcoding these into Struts is *not* a good idea. It's an extremely
small wheel to reinvent public static final String SUCCESS = "blah"; :-).

Well, WebWork(2) defines them as constants for you. I use "success" and "failure" as my mapping names. Its a pretty standard thing. And so what if its defined in Struts? No one is forcing anyone to use it, but the primary defaults would be built-in as constants.


I still don't see a need for a SuccessAction in the first place. Why is
it any better than using a ForwardAction?

Its a lot better in my opinion. Having to define a mapping in a parameter attribute doesn't sit well with me. I use inputForward="true" on my configuration, and all my forward mappings are defined with a <forward> element, not even in input, or parameter.


Having a SuccessAction makes it much easier to do skeleton/storyboarded sites and fill in the details later. Switching from a SuccessAction to a real action when the time is right requires only changing the class name, not the structure of the action mapping XML too. In my Advanced Struts talks, I recommend a SuccessAction over ForwardAction as how I do it. Of course everyone's mileage may vary.

Erik


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



Reply via email to