You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 23 Next »


It's the action's job to take biz objects from the service and convert them (if necessary) for display on the screen, and take data from the jsp and convert it to biz objects to send to the service. An action should do only one thing, i.e. we aren't doing actions the "multiple method" way.

For apps that use SAP, all your actions should be subclasses of SAPBaseAction which is, in turn, a subclass of IDDAction which is a subclass of Strut's Action. (org.apache.struts.action is the core of the struts framework, providing the "Controller" aspect of a MVC model. Action is one of the classes in this core code.)

If the action is an entry point (i.e., chained to /EntryAction or /XXXEntryAction which is associated with the class edu.mit.mortar.controller.action.GlobalEntryAction in the action-servlet.xml)  the following steps automatically happen when someone launches your application via this entry point:

  1. The method edu.mit.mortar.controller.action.GlobalEntryAction.execute is called and a session is created and the following session attributes are set:
    1. GlobalKeys.SAP_SYSTEM_ID
    2. GlobalKeys.WAS_SYSTEM_ID
    3. GlobalKeys.WAS_HOST
    4. GlobalKeys.USER_HOME
  2. Your action (which has been configured to chain after /EntryAction) is called which immediately calls the method IDDAction.execute which sets the following session attributes:
    1. GlobalKeys.CERT
    2. GlobalKeys.USERNAME
    3. GlobalKeys.KERBID
  3. At the end of IDDAction, SAPBaseAction.doProcess is called which opens a connection to SAP.
  4. At the end of SAPBaseAction, your action's method doAction is called within a MessageRuntimeException try catch. (If an Exception is encountered at this point, processing will stop and the user will be sent to the GlobalKeys.FAIL jsp page with a MessageRuntimeException unless your action intercepts the MessageRuntimeException and handles it.)
  5. If your action's method doAction calls a SAP RFC, SAPServiceSupport.execute is eventually called and

This provides automatic RFC error message handling (i.e. it takes all rfc messages and stores them into the struts actionmessages automatically).

  • No labels