Is your implementation of this code closed source, or are you able to
share it ? I would be keen to have a look. Cheers, Cameron Rob Rudin wrote: Cameron - I'm using the latter approach, although this is with 1.3, and I've unfortunately been lazy and haven't looked into WW2 yet. But I assume an ActionInvocation is similar to an Action? In 1.3, I have a "SpringActionFactoryProxy" that checks to see if the Action is defined in the Spring configuration. If it doesn't find the Action, then the JavaActionFactory eventually loads the Action (which is good so that you don't have to configure Action's that don't need resources from the Spring container). I also use the Hibernate interceptors, and everything works well, and the Webwork files aren't polluted with any Spring stuff. I think this sounds similar to what you suggested below, so I'd say go for the latter.Rob ---- On Sat, 01 Nov 2003, Cameron Braid ([EMAIL PROTECTED]) wrote:Is anyone working on integration between Xwork and the SpringFramework.I have managed to create a webwork interceptor that allows axworkaction to make use of any spring bean by creating a simplemapping.However, I would like a better soloution that uses spring asthe actionfacory.. And I would like to do this without duplication of configuration in both xwork.xml and applicationContext.xml One main reason that I want to use spring is to take advantageof itsAOP framework, and most specifically the Hibernate TransactionInterceptor.Therefore I would like to declare the transactional attributesfor theaction methods within spring, with a refrence to the xworkaction.I woule like to still use WebWork's interceptors as normal -timing,logging, params, chain, etc.. because they have differentsemantics tospring. One way that I think this is possible is to create : Spring Objects : a spring action factory bean, configured with the actionnamespaceand name and the transactional attributes this factory would lookup the action config for theclassname andconstruct the action, wrap it in a proxy, attaching theinterceptors.WebWork Objects SpringServletDispatcher - to callActionProxyFactory.setFactory(newSpringActionProxyFactory()) SpringActionProxyFactory - to overridecreateActionInvocation to usea SpringActionInvocation SpringActionInvocation - to override createAction - todelegate toWebApplicationContextUtils.getWebApplicationContext(servletContext).getBean(beanName)to use the factory within spring to contruct this action. This way the xwork.xml file remains untouched and all that isneeded isa bean entry in applicationContext.xml that defines eachaction'stransactional attributes. Something like : <bean id="defaultActionTransactionAttributes" class="com.datacodex.spring.beans.PropertiesFactoryBean"> <property name="properties"> <props> <propkey="execute">PROPAGATION_REQUIRED</prop></props> </property> </bean> <bean id="admin.SpringAction"class="WebworkActionFactoryBean"><property name="action"><value>/admin/SpringAction</value></property> <property name="transactionManager"><ref local="transactionManager"/></property> <property name="transactionAttributes"><ref local="defaultActionTransactionAttributes"/></property> </bean> I am open to suggestions for other ways to do this. Anyone have any thoughts / ideas ? Cameron -- Any damn fool can write code that a computer canunderstand...The trick is to write code that humans can understand. [Martin Fowlerhttp://www.martinfowler.com/distributedComputing/refactoring.pdf]------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help ushelpYOU! Click Here: http://sourceforge.net/donate/ _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED]https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/ _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork -- Any damn fool can write code that a computer can understand... The trick is to write code that humans can understand. [Martin Fowler http://www.martinfowler.com/distributedComputing/refactoring.pdf]------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/ _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork |
- [OS-webwork] Anyone working on Spring Framework Integra... Cameron Braid
- Re: [OS-webwork] Anyone working on Spring Framewor... Tim Dwelle
- Re: [OS-webwork] Anyone working on Spring Framewor... Rob Rudin
- RE: [OS-webwork] Anyone working on Spring Fram... James Cook
- Re: [OS-webwork] Anyone working on Spring ... Cameron Braid
- Re: [OS-webwork] Anyone working on Spring Fram... Cameron Braid
- Re: [OS-webwork] Anyone working on Spring ... Matthew E . Porter
- RE: [OS-webwork] Anyone working on Spr... Patrick Lightbody