Versions Compared

Key

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

...

Code Block
titlestruts.properties
actionstruts.objectFactory = spring

Autowiring

...

Code Block
titleWiring Mode
actionstruts.objectFactory.spring.autoWire = type

...

Code Block
xml
xml
titlestruts.xml
<!DOCTYPE xworkstruts PUBLIC
    "-//OpenSymphonyApache Software GroupFoundation//XWork 1DTD Struts Configuration 2.0//EN"
    "http://wwwstruts.opensymphonyapache.comorg/xworkdtds/xworkstruts-12.10.dtd">

<xwork><struts>
    <include file="webworkstruts-default.xml"/>

    <package name="default" extends="webworkstruts-default">
        <action name="foo" class="com.acme.Foo">
            <result>foo.ftl</result>
        </action>
    </package>

    <package name="secure" namespace="/secure" extends="default">
        <action name="bar" class="bar">
            <result>bar.ftl</result>
        </action>
    </package>
</xwork>struts>

Where you have a Spring bean defined in your applicationContext.xml named "bar". Note that the com.acme.Foo Action did not need to be changed, because it can be autowired.

...