Date: 2004-09-19T08:17:43
Editor: MichaelMcGrady <[EMAIL PROTECTED]>
Wiki: Apache Struts Wiki
Page: StrutsCatalogDispatchUtil
URL: http://wiki.apache.org/struts/StrutsCatalogDispatchUtil
no comment
Change Log:
------------------------------------------------------------------------------
@@ -2,7 +2,8 @@
== Table of Contents ==
{{{
1 Table of Contents
-2 DispatchUtil or (new) DispatchAction: Universal Button Solution for Struts
+2 PROBLEM: Universal Button Solutions: ------------------------------ PROBLEM
+ SOLUTIONS: DispatchUtil, (new) DispatchAction, ButtonTagUtil
3 Uses
3.1 Action Class Code
3.2 Mulitiple Image Tags
@@ -13,13 +14,13 @@
3.7 struts-config.xml Uses
3.7.1 MappingDispatchAction
3.7.2 LookupDispatchAction
-4 DispatchUtil Code
-5 SimpleDispatchAction
+4 SOLUTION ONE: DispatchUtil Code ----------------------------------- SOLUTION ONE
+5 (new) DispatchAction
5.1 Discussion
-5.2 SimpleDispatchAction Code
-6 POJO: Solution for Tags without Dispatch, without Reflection, without
ActionMapping or Even without Struts
+5.2 SOLUTION TWO: (new) DispatchAction Code --------------------------- SOLUTION TWO
+6 POAO (plain old action object or even non-struts): Solution
6.1 Discussion
-6.2 ButtonTagUtil Code
+6.2 SOLUTION THREE: ButtonTagUtil Code -------------------------------- SOLUTION
THREE
7 Links
8 Comments (Peanut Gallery)
@@ -27,7 +28,10 @@
}}}
== Universal Button Utility for Struts ==
-There is a persistent problem of handling multiple buttons, and this is especially a
problem when the buttons are images. Struts has provided a solution for this with
DispatchAction and its progeny. There are various other solutions. I have provided
one at StrutsCatalogImageTagUtil. I have actually provided two solutions there. The
following solution is, I think, superior in every way. What it does is to merge the
best parts of StrutsCataglogImageTagUtil and DispatchAction. I would not recommend
putting this sort of class into Struts. Others might improve on this. I expect they
will. Putting classes like this into Struts creates bloat that is difficult to
jettison when improvements are found. I really appreciate the functionality of such
classes as DispatchAction, LookupDispatchAction and MappingDispatchAction, but
actually putting them into Struts would be akin, I think, to Sun putting its tutorials
into the actual code of Java.
+There is a persistent problem in web applications in handling multiple buttons, and
this is especially a problem when the buttons are images.
+
+
+Struts has provided a solution for this with DispatchAction and its progeny. I have
found this solution to be too heavy, too complicated, and too obtuse. So, I have
engendered my own.
The principle reason for this class is the problem with <input type='image'
name='whatever'> tags in HTML. Those tag send the values in the name attribute as
''whatever.x=9'' and ''whatever.y=26''. DispatchAction and its progeny provide a
melange of solutions but no common way to deal with ''<a href='whatever.do'>'',
''<input type='submit'>'', ''<input type='image'>'', ''<input type='file'>'', or
whatever. This class, DispatchUtil does that. If you prefer to use a subclass, just
provide the functionality in this class in a class extending Action. Herbert Rabago
came up with the idea of providing the functionality in a utility class and I really
like that idea. So, here we go.
@@ -451,15 +455,11 @@
=== Links ===
-StrutsCatalogMultipleImageTagsSimplified
-
StrutsCatalogInstrumentableForms
-StrutsCatalogSimpleDispatchAction
-
StrutsCatalogMappedBeans
-StrutsCatalogHidingImagesAndOtherResourcesUnderWEBINF
+["StrutsCatalogHidingImagesAndOtherResourcesUnderWEBINF"]
== Comments (Please Put Comments Here) ==
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]