Action Forwarding
The execute() method must return an ActionForward object.
In our example, in the case of login success an ActionForward object is
retrieved from the ActionMapping object passed as the first parameter to
execute(). How does an appropriate forward object get put on the mapping
object?
- Recall yet again the
login action
element
- contains named forward subelements
- Struts builds
ActionForward objects associated with each and stores them in the
ActionMapping object
- The execute() method can access them
by name using the findForward() method
- In our example,
execute() always returns a forward associated with success
- That forward passes control to a showoptions action.