Has any one implemented pluggable decorators for Actions? By that I mean things that 
would wrap around an action and add extra behavior.  We've done this using the 
Template Method approach, where derived action classes can overrided beforeExecute, 
afterExecute hooks in a base action.  One could also do this by extending 
RequestProcessor.  The problem with these inheritance based approaches is that you 
can't mix and match different decorators very easily, without leading to a 
combinatorial explosion of derived classes.  

One can do this with servlet filters, but sometimes its nice to do this within Struts, 
to look at the action mapping, pick an action forward, etc.  I could imagine libraries 
of pluggable 'ActionFilters' for checking that the user is logged in, security, 
transaction demarcation, logging, etc.  Applications could pick and choose which ones 
they want, a la carte style.  One could write a request processor that would take a 
configured list of these 'filters', build a filter chain, and run them around each 
Action.execute invocation.   Has anyone done anything like this?  Any issues to watch 
out for?

Thanks.

Steve Molitor

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

Reply via email to