Hi everybody,
We've seen a few different ways to integrate Stripes with Spring.
There's the built-in @SpringBean annotation, and Christian Nelson
recently shared an Interceptor implementation that allows the use of
the @Autowired annotation in ActionBeans. What both of these have in
common is that the ActionBean becomes a recipient of injected
dependencies, but does not become a Spring Bean itself.
I was interested in being able to use the Spring transaction and
security annotations within my ActionBeans. It turned out that the
only viable way to do this was to make the ActionBeans fully-fledged
Spring beans. So that's what I did.
Some of you probably know that Stripes 1.5.1 (not yet released) will
include an ObjectFactory interface that provides a way for us to
control the instantiation of most of the common Stripes components. I
have added the SpringObjectFactory to the StripesStuff project. It
turns ActionBeans and Interceptors into actual Spring beans, thus
allowing the use of annotations for transactions and security.
Regarding dependency injection, I assume that this will be compatible
with the Stripes @SpringBean annotation, and it should also work with
@Autowired, but since that was not my goal, I did not test this. I
would really appreciate if those interested would test the DI and send
me feedback.
There are some limitations related to 1) Spring component-scanning and
2) the need to use CGLib proxies - see the release notes for details.
Please note that if you want to try this before Stripes 1.5.1 is
released, you will need to check-out and build Stripes from the source!
Chris.
To download, visit the Stripes Stuff Main Page (http://www.stripes-stuff.org/
), then go to "Download", then "Browse All Packages":
Direct links:
SpringObjectFactory Distribution Zip
Release notes and setup instructions
Source (in subversion)
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you. Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users