Versions Compared

Key

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

...

The purpose of this configuration file is to integrate Spring with Struts by defining your Struts Actions in your Spring configuration.

It should contain a bean entry for every action in your app and these beans should be defined as singletons. The bean names in action-servlet.xml must match a corresponding action path in the action-mappings section of your struts-config.xml. So for instance, in the oas-skeleton, the bean name="/EnterSearchCriteria" in the action-servlet exactly matches the action path="/EnterSearchCriteria" in the struts-config and they both refer to one of the three actions you will find in the oas-skeleton (edu.mit.oasskeleton.controller.action.EnterSearchCriteriaAction).

Your app can have any number of entry points. Each of the entry points would have an action that can be configured in the action-servlet.xml to use the class edu.mit.mortar.controller.action.GlobalEntryAction. However, they these bean names must be named XXXEntryAction (where XXX is some name you choose), otherwise the session restart mechanism will cause your app to loop infinitely.

The example below is from the oas-skeleton and which comes with all new projects set up by the IDD Team. In this example there is a single entry point, /EntryAction, which is configured to chain to a specific action within the application in (<forward name="Chain" path="/EnterSearchCriteria.do" redirect="true"/>) in the struts-config.xml. There file.

In addition to this /EntryAction bean, there are an additional 3 skeleton actionsbeans that correspond to the 3 actionsin the oas-skeleton. In order to properly configure your application, you must change these 3 beans to reflect the actions in your application:

...