Juergen, That's funny - I was just talking with Don about refactoring some stuff. Good timing!
+1 for moving it to Spring's repository where it belongs. I made a few changes today (just checked them in) you might want to know about: How to use the SpringPlugin: 1. Put nothing to initialize Spring in web.xml. Use the Plugin to do this. - Specifying a "beansConfig" path will load it from a custom path. - No path will default to "/WEB-INF/applicationContext.xml". - If your webapp has multiple config files - use #2 below or specify a "contextConfigLocation" variable as a <context-param> in web.xml. The values for this parameter should be comma-delimited. 2. Put Spring initializers (ContextLoaderListener or ContextLoaderServlet) in web.xml and put nothing in struts-config.xml. Note that only #1 will work if you are using MockStrutsTestCase to test your actions. IMO, this is quite powerful b/c you can use it to test your Struts Actions w/o a container. I've cc'd the struts-apps mailing list so Don Brown (the original author) can help us make this transition. Matt P.S. Since SF's anonymous CVS takes a while to catch up, I've uploaded the latest source to http://static.raibledesigns.com/downloads/struts-spring-0.3.zip. It's a 6 MB download b/c of the refactored struts-example app. --- jürgen_höller_[werk3AT] <[EMAIL PROTECTED]> wrote: > Matt, > > I've just read that on the Spring Live blog that you're refining Don Brown's > Struts Spring Plugin. That reminded me that I've repeatedly considered > including something like this Plugin in the main Spring distribution. > Particularly if it is just two classes, I don't have worries about size and > scope. A main benefit is that it would be available out-of-the-box with > Spring, just like all the integrated data access and view technologies. > > Actually, I intend to completely rework the Plugin far beyond its current > implementation. It should properly have its own XmlWebApplicationContext, by > default loaded from "/WEB-INF/<servlet-name>.xml", having the Spring root > application context (if any) as parent, just like a Spring DispatcherServlet. > > The beans in the Spring context can have the same name as the corresponding > Actions in struts-config.xml. Simply don't use <bean id="..."/> but rather > <bean name="..."/>, which allows any special characters like in "/logon.do". > The original Plugin was written against Spring 1.0 M1 where this wasn't > available, IIRC. > > SpringAction's looking up of the corresponding Spring bean and setting the > ActionServlet can be significantly optimized. Actually, I consider the > current implementation unsafe: It first sets the ActionServlet on the located > Action (a shared instance) and then resets it to null again (on each > execution!). This is not at all thread-safe. > > If noone objects, I'll come up with an optimized implementation for the > standard Spring codebase within the next couple of days. We're about to > release Spring 1.0.1 next week, and I'd be willing to already include this > special Struts support in that release, if the stuff is as simple as I assume > (or in 1.0.2, if it takes longer). > > Juergen > > > __________________________________ Do you Yahoo!? Yahoo! Small Business $15K Web Design Giveaway http://promotions.yahoo.com/design_giveaway/ ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Struts-apps mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/struts-apps