snip

Maybe you are referring to the LookupDispatchAction

Yes, LookupDispatchAction. Sorry.

The way I originally extended LDA, each Action contained a hard coded mapping of submit button values-> method names. (obviously a "bad thing" :-) Wendi's idea, if I'm getting it right, sounds pretty good. Just store the mappings between submit buttons and methods in the ApplicationResources.properties file along with everything else, and then extend LDA in such a way that it looks in there to figure out which method to invoke. That seems cleaner since:
1) Anytime we are adding/changing a button we'll be editing that file anyways
2) The button that was clicked gets automatically submitted as part of the request (no need for an extra hidden HTML form element in all the JSP's)
3) It removes the "method" attribute from all of our Struts forms
4) If for some reason we ever need to execute a bit of locale specific logic in the Action, it would be as simple as adding a line to that locale's property file.


Oh shoot. I just remembered the other thing that was tripping me up with LDA. We had a few screens where more than one button shared the same text but had entirely different meanings. (Two "OK" or "Delete" buttons in different areas) Since LDA does a reverse lookup based on the text I was back to either client side JS or if-then-else logic in the method of the action. I think since screens without duplicate buttons outnumber screens with them by something like 10-1 we'll go the ApplicationResources.properties route.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to