|
From: <jue...@we...> - 2004-04-05 20:00:48
|
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=3D"..."/> but rather <bean name=3D"..."/>, 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 |