Mike Casey wrote:
Can anyone tell me the experiences they have had with running cocoon with spring? In particular, how did you get Spring to run Cocoon and how was this deployed under tomcat? Does the spring MVC framework get in the way of things? Or could they possibly complement each other?

The simplest integration is probably to initialize the Spring application context in web.xml with a ContextLoaderListener:

<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

Then you can get access to the application context from anywhere you have a cocoon Context object, e.g. from flowscript:

var appCtxt = cocoon.context.getAttribute(
Packages.org.springframework.web.context.WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE
);
var myService = appCtxt.getBean("myServiceBean");

There are also other techniques for getting access to Spring managed services; do a search for "spring" at http://wiki.apache.org/cocoon for some examples.

The next major version of Cocoon (2.2 or 3.0, not sure what it will end up being labeled) has actually been changed so that it uses Spring internally for its component management, so the integration should be that much cleaner.

In terms of Spring MVC, I don't know how it and Cocoon would play alongside each other, since Cocoon is itself an MVC framework. Personally I've never seen a need to use Spring MVC when I've got such a good one in Cocoon. :) I'd be interested to hear if anyone else has had experience combining them though.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]