I've run across something slightly confusing to me in getting Dependency Injection with Spring to work with Type Converters under
Struts 2.
I tried creating a StrutsTypeConverter subclass that had a @Transactional annotation with a @PersistenceContext on an EntityManager field. The Converter was declared as a bean in the applicationContext. However the EM was not injected.
I then made a wrapper class (Workspace) around an EntityManager (only exposes a get/set EntityManager), this wrapper class also had the @Transaction and @PersistenceContext annotations. The Workspace was declared in the application context.
I then made the converter expose a setWorkspace method. The converter was no longer listed in the ApplicationContext. However now the EM gets successfully injected into the Workspace; and the Workspace gets injected into the converter.
What is the difference, in these two approaches that causes one to work and one to not?
Is there something unique about the StrutsTypeConverter class that causes auto-wire by name works successfully (without even a bean definition of the converter), but not @Transactional/@PersistenceContext annotations?