Child pages
  • How can we create our Action objects from the Spring configuration

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

  1. Add struts.objectFactory = spring to the struts.properties.
  2. Add the Spring listener to the web.xml.
    Code Block
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
  3. Add the Spring configiuration file to the WEB-INF folder.
    Code Block
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
    <beans default-autowire="autodetect">
        <bean id="personManager" class="com.acme.PersonManager"/>
        ...
    </beans>

(lightbulb) For details, see Initializing Actions from Spring.