Niall Pemberton wrote:
Thatt "slightly different mechanism" changes pretty much completely how you can relate to the view. _/*You have to remember that these two classes are obtaining the method name from different places*/_. Remember too that SimpleDispatchAction does not merely replace DispatchAction, it replaces DispatchAction, LookupDispatchAction and MappedDispatchAction. That should show that, while it may (and does) look like a simple change (and is a simple change) the results are radically different because of how it relates to the view. For example:I don't see anything radically different in SimpleDispatchAction to the other DispatchAction flavours - it just uses a slightly different mechanim for determining the method name to execute and it doesn't throw an exception if the "parameter" is null.
With SimpleDispatchAction, for /any /number of methods, you might have a struts-config.xml that looks like:
| <action path="/subscription" type="org.example.SubscriptionAction">
</action>|
With MappingDispatchAction, for a create, edit, save, delete, and list set of methods, you would have to have the following:
| <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>
<action path="/listSubscriptions" type="org.example.SubscriptionAction"
parameter="list">
<forward name="success" path="/subscriptionList.jsp"/>
</action>
|
Additionally, what will occur on the page will be completely different. That does not mean a link won't be a link and a file browse won't be a file browse, etc. What it means is that the view code will be broken.
I am a pretty good coder and sometimes not the best communicator on these things because I tend to come from a different angle, being self-trained. Rick Reumann is changing some things to use this instead of MappingDispatchAction, I think. Maybe he can be helpful to you on this.
Michael McGrady
||||| |
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]