MappingDispatchAction[jakarta.apache.org]

Struts1.2からできたMappingDispatchAction。 今までのDispatchActionと違ってstruts-config.xmlでのマッピングがそれぞれのアクションごとで別々なので、バリデーションを使い分けたりすることができるので便利。
DispatchActionのマッピング例:


<action path="/recordAction"
type="app.RecordDispatchAction"
name="recordForm"
scope="request"
validat="true"
input="record.jsp"
parameter="method"> ←methodという名前でパラメータの受渡しをする。
<forward name="success" path="confirm.jsp"/>
</action>


MappingDispatchActionのマッピング例[jakarta.apache.org]:


<action path="/createSubscription"
type="org.example.SubscriptionAction"
parameter="create">
<forward name="success" path="/editSubscription.jsp"/>
</action>
<action path="/editSubscription"
type="org.example.SubscriptionAction"
parameter="edit">
<forward name="success" path="/editSubscription.jsp"/>
</action>
<action path="/saveSubscription"
type="org.example.SubscriptionAction"
parameter="save"
name="subscriptionForm"
validate="true"
input="/editSubscription.jsp"
scope="request">
<forward name="success" path="/savedSubscription.jsp"/>
</action>
<action path="/deleteSubscription"
type="org.example.SubscriptionAction"
name="subscriptionForm"
scope="request"
input="/subscription.jsp"
parameter="delete">
<forward name="success" path="/deletedSubscription.jsp"/>
</action>
このように、パラメータでメソッドの名前を指定する。