I'm using org.apaches.struts.actions.LookupDispatchAction to process different form submissions from the same page. There are several buttons on the page that will submit the form. I want a specific method in the Action class to process a specific form button. That's what LookupDispatchAction is for, right?
My problem is that it seems that buttons must be labelled distinctly, but I want to label them all with the same value.
Here's a represenative button declaration on the page:
This is how I've declared the labels in ApplicationResources:
In my Action class (which extends LookupDispatchAction), the keyMethodMap looks like this:
My struts-config is set up properly and the page renders correctly. But when I click one of the submit buttons, the most observed behavior is this: The method that gets called is the one associated with whatever message key appears last in ApplicationResources. In the scenario above, sumSales() is called regardless of which button I click. If I recode ApplicationResources such that the order is reversed (button,3, button.2, button.1), then sumInventory() is called - whatever button I click. If I rename the labels in ApplicationResources, e.g.
everything works fine.
I thought the whole point of LookupDispatchAction was to be able to use buttons with the same label but call different methods? I'm using
Struts 1.1. Can this be a bug?