20040120 Tuesday January 20, 2004

Struts' MappingDispatchAction I stumbed upon Struts' MappingDispatchAction this morning. It's basically the same thing as the LookupDispatchAction (which I use as my BaseAction in AppFuse), but you specify the method name in the action-mapping - rather than with request parameters (i.e. ?action=methodName). At first, this would seems tedious, but I usually end up creating a lot of action-mappings for a single action anyway, so this might be the way to go. There's really no need to change this in AppFuse now, but it is available in AppFuse's struts.jar (nightly from Dec 2, 2003).

In other news, the Open Source book is humming right along. I've finished the Hibernate, WebWork and Sitemesh chapters. I like what I see. IMO, this book is excellent for Hibernate, WebWork and Sitemesh newbies like me. Posted in Java at Jan 20 2004, 05:38:43 AM MST 2 Comments

Comments:

I've been using MappingDispatchAction for a while, and it's definately my favorite *Action now. It allows for a more declarative approach to building Struts applications, as you can create a separate Action Mapping, instead of a separate Action, for every "function" you need. Of course, (Lookup)DispatchAction is still useful when you have multiple submit buttons on a single page, as MappingDispatchAction is designed for 1:N, rather than N:N, mappings.

Posted by Pratik Patel on January 20, 2004 at 08:26 AM MST #

For example updating DB record in classic approach you have to have two actions; first for populating FormBean (after that you offer this data for change on "EDIT.JSP" with form) and after that you need second action for updating data. For first action you do not need to have a validation (because there's no input JSP) and for second you need validation (EDIT.JSP is input). Having MappingDispatchAction one can assemble the whole logic of populating formbean/updating record in only one action because one can have two mappings for population and update processes having validation off and on respectively.

Posted by Stjepan Brbot on April 07, 2004 at 02:09 PM MDT #

Post a Comment:
  • HTML Syntax: Allowed
Click me to subscribe
Matt Raible is a Web Architecture Consultant specializing in open source frameworks.
« May 2012
SunMonTueWedThuFriSat
  
1
2
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
23
24
25
26
27
28
29
30
31
  
       
Today

Recent Entries

Tag Cloud