Versions Compared

Key

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

...

It should contain a bean entry for every action in your app and these beans should be defined as singletons. Since the beans are defined as singletons it is important to make sure the action is thread-safe which means the action class should not have any instance variables, non-local non-static variables (defined within class but outside of a method, conditional statement, loop etc). Check out this page for a discussion of instance versus static variables.

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).

...