struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick Lightbody <>
Subject Re: [s2] Validation
Date Thu, 03 Aug 2006 15:19:31 GMT
OK, I think I see where you are coming from. I guess we are coming across a difference of opinion,
but  let me explain how I would do the exact same thing:

 - Like you, I would have a single action class that has multiple methods to invoke (input,
save, list, whatever)
 - I would not, however, have different stacks. In fact, I go just the opposite: I try to
have one global stack for every action. In cases like yours where the stack needs to behave
differently, I design the interceptor to look for an annotation or convention, much like today's
WorkflowInterceptor and ValidationInterceptor do.
 - I would have one action configured (well, actually pulled in via convention) and then use
foo!bar syntax.

What do you think of that?

Of course, my approach won't work with the efforts Don and Ted are pushing for: removing foo!bar
syntax as a recommended option.

Ted, Don: what would you guys do in the scenario Jason provided?

I should point out that in my scenario, there is no need for any configuration - just some
common conventions that tend to work very well (for me). I wouldn't even be happy doing a
wildcard configuration for each entity, though I think that would be better than Jason's approach
(assuming you could define a single stack with different behaviors).

> > Jason, I have to disagree with you on this. I've
> > written a lot of WebWork apps and multiple aliases
> is
> > rarely used (maybe 1-5% of the time for me).
> Perhaps
> > you can give the common examples you come across
> so
> > that we can understand your style better?
> > 
> I think I posted this last week, but here's the
> Invoice CRUD action definitions:
> <!-- Invoice CRUD Actions -->
> <action name="listInvoice"
> e"
> class=""
> method="list">
>       	  	<interceptor-ref name="listStack"/>   
> sult name="CRUD-list"
> type="freemarker">/template/eplus/metaDataList.ftl</re
> sult>   	  	
>       	</action>
> <action name="editInvoice"
> "
> class=""
> >
>           	<interceptor-ref name="editStack"/>
> ction>
> <action name="saveInvoice"
> "
> class=""
> method="save">
>           	<interceptor-ref name="crudStack"/>
> ction>
> <action name="deleteInvoice"
> "
> class=""
> method="delete">
> <interceptor-ref name="crudStack"/>
> >          
>       	</action>
> at for each entity in the system...
Posted via Jive Forums

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message