struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Newton <newton.d...@yahoo.com>
Subject Re: usage of Preparable interface?
Date Thu, 01 May 2008 13:42:10 GMT
--- Jeromy Evans <jeromy.evans@blueskyminds.com.au> wrote:
> I've been toying with the idea of creating a custom interceptor to do 
> this.  It would be effectively the same as you describe, except that it 
> would inspect the action for the presence of some interface, annotation, 
> or method, and examine the request for some characteristic (eg. get 
> method) and if matched it creates/looks up the model and injects it into 
> an appropriate scope (eg. into the action, into the action context, 
> request scope, or onto the valuestack). 
> 
> That way you could remove all the boilerplate from your actions.
> 
> eg, If it placed the model into the actioncontext you could potentially use
> <s:select name="state" list="#states"/>
> without your action providing the list or getter at all (except 
> something must instruct the interceptor to load it). 

Annotated, parameterized with an injectable load implementation?

The load impl takes a context, from which it could use whatever information
needed to create/load the object, or be stubbed during development and
testing.

Dave


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message