struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeromy Evans <>
Subject Re: S2: TypeConverters and Spring Injection
Date Wed, 27 Aug 2008 07:03:41 GMT
nielsene@MIT.EDU wrote:
> Is there something unique about the StrutsTypeConverter class that causes
> auto-wire by name to work successfully (without even a bean definition of the
> converter), but not @Transactional/@PersistenceContext annotations?
> Thank you.

It's a guess, but I would say yes.

StrutsTypeConverter instances are created by the ObjectFactory, which is 
implemented by the Struts2 Spring Plugin.
By default, the plugin calls on an AutowritringCapableBeanFactory to 
instantiate everything requested via the ObjectFactory so you don't 
require bean definitions for S2 actions, S2 converters or S2 interceptors.

I suspect what you're seeing is that:
 - beans created via the ObjectFactory are using one wiring strategy; but
 - beans created directly via your application context are using a 
different wiring strategy.
The autowire strategy can be changed via a plugin property.  It should 
be possible to instruct the plugin to use a strategy that recognises the 
annotations (but perhaps its not supported).

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

View raw message