Hi all,
We are expanding an old Struts 1 project to be Spring managed - yet we wish to change the code and the flow as little as possible. We have therefore decided to leave Struts to manage the requests and have delegated the actions via the org.springframework.web.struts.DelegatingActionProxy
class.
Example:
The struts-config.xml contains:
<action name="InvalidSession"
path="/pages/InvalidSession"
type="org.springframework.web.struts.DelegatingActionProxy"
scope="request">
<forward name="success" path="/pages/Startup.do" />
</action>
The action-servlet.xml contains:
<bean name="/pages/InvalidSession"
class="com.xxx.actions.InvalidSessionAction" />
Now the plot thickens:
Normal Spring beans have been defined in the applicationContext.xml. An example:
<bean id="parserUtils" class="com.xxx.el.parser.ParserUtils" >
<property name="parserFactory" ref="parserFactory"/>
</bean>
I now wish to wire (not automatically - but that is not an issue) the parserUtils
bean to an ActionForm.
Had I wanted to wire it to an Action I would simply define the follwing in the action-servlet.xml:
<bean name="/pages/CaseUpdate"
class="com.xxx.actions.CaseUpdateAction" >
<property name="parserUtils" ref="parserUtils" />
</bean>
where the following is in the struts-config.xml:
<action path="/pages/CaseUpdate"
name="CaseUpdateForm"
type="org.springframework.web.struts.DelegatingActionProxy"
scope="request">
<forward name="success" path="/pages/SwitchView.do" />
</action>
But the stuts-config also contains the following ActionForm definition:
<form-bean name="CaseUpdateForm"
type="com.xxx.forms.CaseUpdateForm" />
and I wish to wire the parserUtils
bean to the CaseUpdateForm class.
What must I do?
Thanks all!