There are multiple ways to integrate spring into webwork2/xwork

It really depends on what you want.

The most simple soloution that I have buit for our apps is:

1) All of our business logic are implemented in beans that are managed by
spring.  They all implement the com.datacodex.Service interface
2) I wrote a XWorkInterceptor to auto wire the webwork2 actions by type. It
is attached.

That is it - quite simple - and automatic.

Some problems that may arise with this technique are :

1) multiple beans in spring of the same type
  a) you could modify the provided interceptor to autowire by type AND by
name

2) your business objects don't implement a set interface
  a) you could attach a marker interface to them quite easily, or
  b) you could autowire by Name only, or
  c) you could use spring as an action factory (more complex integration and
confgiuration)

I will, when time permits update the webwork2/xwork wiki describing this
pattern, and these options.

I also plan on adding this code into the webwork-optional or
webwork-extensions project.

One thing that may help with 2c is if webwork/xwork supported configuration
for factories, rather than hardcoding them in. - Pat / Jason .. Any comments
here 

Cameron

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of Patrick Lightbody
> Sent: Tuesday, 24 February 2004 10:07 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [OS-webwork] Spring integration (revisited)
> 
> We want to get this stuff in to the webwork-extras project 
> asap so that there is a common place for these types of 
> integrations. If anyone wants to try their hand at this, just 
> drop me an email and request developer access to 
> webwork-extras project to get commit access.
> 
> Patrick
> 
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] 
> On Behalf Of 
> > Francisco Hernandez
> > Sent: Saturday, February 21, 2004 10:09 AM
> > To: [EMAIL PROTECTED]
> > Subject: Re: [OS-webwork] Spring integration (revisited)
> > 
> > I was able to get this working by following the directions 
> on the jira
> > issue:
> > http://jira.opensymphony.com/secure/ViewIssue.jspa?key=XW-122
> > 
> > check out the SpringSupport.zip and look at the tests, they are also
> of
> > help to see how all if this works together.
> > 
> > 
> > 
> > Robert Lerner wrote:
> > 
> > > Hola compadres!
> > >
> > > [I'm kind of new to both webwork and spring but strongly 
> feel that 
> > > they are great projects... so please go easy on me if I ask some 
> > > incredibly stupid questions :-)]
> > >
> > > I'm working on a project where we are using webwork, and 
> spring for 
> > > both IoC and AOP (specifically for the transactions).  
> What I would 
> > > like to do is to have my actions "aware" of the dao that is
> configured
> > > in spring. I've tried to read the previous discussions in the
> mailing
> > > lists on this subject but have not really been able to figure out
> how
> > > to do this. Is it even possible with ww2.0 and xw1.0? If not does 
> > > someone have any idea of how to get this working?
> > > The KW-122 issue in the jira seem to provide a working 
> solution, but 
> > > how do I integrate this in my application?
> > > The xwork-ext stuff,  which i assume that this KW-122 
> stuff has gone 
> > > in to where can i find that?
> > >
> > > Any help greatly appreciated!
> > > /Robert Lerner
> > >
> > >
> > > -------------------------------------------------------
> > > SF.Net is sponsored by: Speed Start Your Linux Apps Now.
> > > Build and deploy apps & Web services for Linux with a free DVD 
> > > software kit from IBM. Click Now!
> > > http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
> > > _______________________________________________
> > > Opensymphony-webwork mailing list
> > > [EMAIL PROTECTED]
> > > https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork
> > >
> > >
> > >
> > 
> > 
> > 
> > -------------------------------------------------------
> > SF.Net is sponsored by: Speed Start Your Linux Apps Now.
> > Build and deploy apps & Web services for Linux with a free DVD 
> > software kit from IBM. Click Now!
> > http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
> > _______________________________________________
> > Opensymphony-webwork mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork
> 
> 
> -------------------------------------------------------
> SF.Net is sponsored by: Speed Start Your Linux Apps Now.
> Build and deploy apps & Web services for Linux with a free 
> DVD software kit from IBM. Click Now!
> http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
> _______________________________________________
> Opensymphony-webwork mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork
> 

Attachment: SpringAutoWireInterceptor.java
Description: Binary data

Reply via email to