Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

What is Spring and Why do you want to use it with WebWork?

Check out http://www.springframework.org for more details about Spring. To summarize, Spring provides several different layers. Spring's IoC container, for instance, provides a nice transparent way to wire together objects with their dependencies, such as services they use. It can also, with the help of its AOP framework, provide transactional behavior to plain Java beans. Spring also provides an MVC framework, which is what could be compared to WebWork. Those believe WebWork is a better MVC framework so would choose WebWork for this part and integrate the rest of the Spring stack.
There are a number of ways to integrate Spring into WebWork.

Use SpringObjectFactory

The xwork-optional package from dev.java.net contains a module xwork-spring that contains all the necessary code to use Spring in WebWork. It contains primarily a SpringObjectFactory to wire up the dependencies for an Action before passing it to WebWork. Each action should be configured within a Spring application context as a prototype (because WebWork assumes a new instance of a class for every action invocation). Specify something like this in applicationContext.xml:

...