You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Tony Pinter <an...@pfizer.com> on 2003/07/22 21:16:35 UTC

DispatchAction descendant and Struts Validator problems

Hey all,

I'm having trouble getting some simple Validator "required" fields working
on a DynaValidatorForm being used in an Action extending a descendant of
DispatchAction.

The action is attached, but it behaves something like this:

Dispatch method: read -
Reads information from an oracle database to populate a multipurpose Tiles
form that is used both for adding and editing the model.
First, get the itemID (primary key) from the request or session. Next, save
a transaction token to the request.  Next, read the associated data from the
database and use the Commons-BeanUtils to map the returned business object
to the DynaValidatorForm.  Next, set the "dispatch" field on the
DynaValidatorForm to "edit" so that my multipurpose Tile jsp form knows to
what dispatch action to submit.  Lastly, forward to the Tileset.

Dispatch method: edit -
Performs an update on the model using the submitted DynaValidatorForm.
First, make sure the user has seen the multipurpose Tile jsp form by
checking to see if the DynaValidatorForm maintains a true value for its
"seenForm" element.  Next, check the sync token to make sure there was no
duplicate form resubmission.  Next, pass the map .getMap() of the
DynaValidatorForm to update the model.  Lastly, forward to a success page.

Dispatch method: add -
Adds an item to the model.
First, make sure the user has seen the multipurpose Tile jsp form by
checking to see if the DynaValidatorForm maintains a true value for its
"seenForm" element.  If not, set a sync request token and forward to the
tile set.  If so, check the sync token and isCancelled for validity.  Next,
use the .getMap() of the DynaValidatorForm to insert an item into the model.
Lastly, forward to a success page.


I want validation to occur on add and on edit but not on read.  My problem,
it seems, is that the validator architecture validates all form submissions
to the DispatchAction, regardless of the method parameter provided.  Is
there any way to validate only specific methods of a dispatch action?  I
suppose that I may need to break my add method into a pre-add and an add to
only validate add submissions, but other than that, I can't see why this
should be so difficult for me to figure out.  Disposing of DispatchActions
entirely might work, but it is less than ideal in a code-reuse and elegance
POV.  And no, I'm not looking to start an elegance holy war.  I'm just a
simple intern.


Incidentally, I devised a little hack to have the unspecified method called
if introspection doesn't find a public method by the value provided with
your dispatch request param.  Maybe I'm mistaken, but it seemed like
unspecified was only called when the dispath parameter was null.  That's not
ideal for silly users that putz with the querystring.
First, subclass DispatchAction and make unspecified public rather than
protected when you implement it.  Next, replace getMethod(String name) with:
  protected Method getMethod(String name)
      throws NoSuchMethodException {
    synchronized (methods) {
      Method method = (Method) methods.get(name);
      if (method == null) {
        try {
          method = clazz.getMethod(name, types);
          methods.put(name, method);
        } catch (NoSuchMethodException nsme) {
          method = clazz.getMethod("unspecified", types);
        }
      }
      return (method);
    }
  }

Anyway, any help would be great,
Tony




begin 666 CruCompoundAction.java
M<&%C:V%G92!C;VTN<&9I>F5R+F-U9"YA8W1I;VYS+F-R=3L-"@T*:6UP;W)T
M(&]R9RYA<&%C:&4N<W1R=71S+F%C=&EO;BY!8W1I;VY-87!P:6YG.PT*:6UP
M;W)T(&]R9RYA<&%C:&4N<W1R=71S+F%C=&EO;BY!8W1I;VY&;W)M.PT*:6UP
M;W)T(&]R9RYA<&%C:&4N<W1R=71S+F%C=&EO;BY!8W1I;VY&;W)W87)D.PT*
M:6UP;W)T(&]R9RYA<&%C:&4N<W1R=71S+F%C=&EO;BY!8W1I;VY%<G)O<CL-
M"FEM<&]R="!O<F<N87!A8VAE+G-T<G5T<RYA8W1I;VXN06-T:6]N17)R;W)S
M.PT*:6UP;W)T(&]R9RYA<&%C:&4N<W1R=71S+F%C=&EO;BY!8W1I;VY-97-S
M86=E.PT*:6UP;W)T(&]R9RYA<&%C:&4N<W1R=71S+F%C=&EO;BY!8W1I;VY-
M97-S86=E<SL-"FEM<&]R="!J879A>"YS97)V;&5T+FAT=' N2'1T<%-E<G9L
M971297%U97-T.PT*:6UP;W)T(&IA=F%X+G-E<G9L970N:'1T<"Y(='1P4V5R
M=FQE=%)E<W!O;G-E.PT*#0II;7!O<G0@:F%V82YU=&EL+DUA<#L-"@T*:6UP
M;W)T(&]R9RYA<&%C:&4N<W1R=71S+G9A;&ED871O<BY$>6YA5F%L:61A=&]R
M1F]R;3L-"@T*:6UP;W)T(&]R9RYA<&%C:&4N8V]M;6]N<RYB96%N=71I;',N
M0F5A;E5T:6QS.P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@(" @(" @(" @(" @
M(" @(" @($AT='!397)V;&5T4F5S<&]N<V4@<F5S<&]N<V4I('L-"B @("!$
M>6YA5F%L:61A=&]R1F]R;2!D=D9O<FT@/2 H1'EN859A;&ED871O<D9O<FTI
M(&9O<FT[#0H@(" @06-T:6]N17)R;W)S(&5R<F]R<R ](&YE=R!!8W1I;VY%
M<G)O<G,H*3L-"@T*(" @(&EF("@A:7-0<F5R97%686QI9"AF;W)M*2D@>R O
M+R!I9B!T:&4@9F]R;2!H87,@>65T('1O(&)E('-E96X-"B @(" @("\O('-A
M=F4@=&]K96X@=&\@8F4@:6YC;'5D960@87,@82!H:61D96X@9F]R;2!F:65L
M9" H:6X@<F5Q=65S="D@86YD(&EN('-E<W-I;VX-"B @(" @('-A=F54;VME
M;BAR97%U97-T*3L-"B @(" @(')E='5R;B!M87!P:6YG+F9I;F1&;W)W87)D
M*")A9&1&;W)M(BD[#0H@(" @?0T*#0H@(" @+R\@8VAE8VL@9F]R(&$@<F5S
M=6)M:7-S:6]N(&]F('1H92!R97%U97-T(&)A<V5D(&]N('1H92!S97-S:6]N
M+W)E<75E<W0@=&]K96YS#0H@(" @:68@*"%I<U1O:V5N5F%L:60H<F5Q=65S
M="P@97)R;W)S+" B861D:6YG(&-O;7!O=6YD(BDI#0H@(" @("!R971U<FX@
M;6%P<&EN9RYF:6YD1F]R=V%R9"@B9F%I;'5R92(I.PT*#0H@(" @+R\@=V%S
M(&9O<FT@8V%N8V5L;&5D/PT*(" @($%C=&EO;DUE<W-A9V5S(&UE<W-A9V5S
M(#T@;F5W($%C=&EO;DUE<W-A9V5S*"D[#0H@(" @:68@*&ES0V%N8V5L;&5D
M*')E<75E<W0L(&UE<W-A9V5S*2D-"B @(" @(')E='5R;B!G971,:7-T1F]R
M=V%R9"AD=D9O<FTL(&UA<'!I;F<I.PT*#0H@(" @+R\@861D('1H92!C;VUP
M;W5N9 T*(" @('1R>2![#0H@(" @("!-;V1E;$%D9$%C8V5S<R!M86$@/2!N
M97<-"B @(" @(" @("!-;V1E;$%D9$%C8V5S<RAG971$871A4V]U<F-E*')E
M<75E<W0L(%1O:V5N+E=$,#$I*3L-"@T*(" @(" @;6%A+F%D9$-O;7!O=6YD
M*&1V1F]R;2YG971-87 H*2D[#0H@(" @?0T*(" @(&-A=&-H("A-;V1E;$%C
M8V5S<T5X8V5P=&EO;B!M864I('L-"B @(" @(&5R<F]R<RYA9&0H06-T:6]N
M17)R;W)S+D=,3T)!3%]%4E)/4BP-"B @(" @(" @(" @(" @(" @;F5W($%C
M=&EO;D5R<F]R*")E<G)O<G,N9&%T86)A<V4N97)R;W(B+"!M864N9V5T365S
M<V%G92@I*2D[#0H@(" @("!I9B H(65R<F]R<RYI<T5M<'1Y*"DI#0H@(" @
M(" @('-A=F5%<G)O<G,H<F5Q=65S="P@97)R;W)S*3L-"@T*(" @(" @<F5T
M=7)N(&UA<'!I;F<N9FEN9$9O<G=A<F0H(F9A:6QU<F4B*3L-"B @("!]#0H-
M"B @(" O+R!F;W)W87)D(&-O;G1R;VP@=&\@=&AE(&%P<')O<')I871E(&QI
M<W0@9F]R('1H92!E9&ET960@8V]M<&]U;F0-"B @("!M97-S86=E<RYA9&0H
M06-T:6]N365S<V%G97,N1TQ/0D%,7TU%4U-!1T4L#0H@(" @(" @(" @(" @
M(" @(&YE=R!!8W1I;VY-97-S86=E*")M97-S86=E<RYW;W)K9FQO=RYS=6-C
M97-S(BDI.PT*(" @(&EF("@A;65S<V%G97,N:7-%;7!T>2@I*0T*(" @(" @
M<V%V94UE<W-A9V5S*')E<75E<W0L(&UE<W-A9V5S*3L-"B @("!R971U<FX@
M9V5T3&ES=$9O<G=A<F0H9'9&;W)M+"!M87!P:6YG*3L-"B @?0T*#0H@("\J
M*@T*(" J($1I<W!A=&-H(&UE=&AO9"!U<V5D('1O(&5D:70@86X@97AI<W1I
M;F<@8V]M<&]U;F0@:6X@=&AE(&1A=&%B87-E#0H@("H-"B @*B! <&%R86T@
M;6%P<&EN9R!3=')U=',@06-T:6]N36%P<&EN9PT*(" J($!P87)A;2!F;W)M
M(%-T<G5T<R!!8W1I;VY&<F]M#0H@("H@0'!A<F%M(')E<75E<W0@<F5Q=65S
M="!O8FIE8W0-"B @*B! <&%R86T@<F5S<&]N<V4@<F5S<&]N<V4@;V)J96-T
M#0H@("H@0')E='5R;B!!8W1I;VY&;W)W87)D#0H@("HO#0H@('!U8FQI8R!!
M8W1I;VY&;W)W87)D(&5D:70H06-T:6]N36%P<&EN9R!M87!P:6YG+ T*(" @
M(" @(" @(" @(" @(" @(" @(" @(" @($%C=&EO;D9O<FT@9F]R;2P-"B @
M(" @(" @(" @(" @(" @(" @(" @(" @("!(='1P4V5R=FQE=%)E<75E<W0@
M<F5Q=65S="P-"B @(" @(" @(" @(" @(" @(" @(" @(" @("!(='1P4V5R
M=FQE=%)E<W!O;G-E(')E<W!O;G-E*2![#0H@(" @06-T:6]N365S<V%G97,@
M;65S<V%G97,@/2!N97<@06-T:6]N365S<V%G97,H*3L-"B @("!!8W1I;VY%
M<G)O<G,@97)R;W)S(#T@;F5W($%C=&EO;D5R<F]R<R@I.PT*(" @($1Y;F%6
M86QI9&%T;W)&;W)M(&1V1F]R;2 ]("A$>6YA5F%L:61A=&]R1F]R;2D@9F]R
M;3L-"@T*(" @(&EF("AI<U!R97)E<59A;&ED*&9O<FTI*2![("\O(&EF('1H
M92!F;W)M(&AA<R!B965N('-E96X-"B @(" @("\O('=E(&-A;B!F;W)G970@
M86)O=70@;W5R(&-O;7!O=6YD260@;F]W("T@=V4@9V]T('=H870@=V4@=V%N
M=&5D(&9R;VT@:70-"B @(" @($-O;7!O=6YD260N<F5M;W9E0V]M<&]U;F1)
M9"AR97%U97-T*3L-"@T*(" @(" @+R\@8VAE8VL@9F]R(&$@<F5S=6)M:7-S
M:6]N(&]F('1H92!R97%U97-T(&)A<V5D(&]N('1H92!S97-S:6]N+W)E<75E
M<W0@=&]K96YS#0H@(" @("!I9B H(6ES5&]K96Y686QI9"AR97%U97-T+"!E
M<G)O<G,L(")E9&ET:6YG(&-O;7!O=6YD(BDI#0H@(" @(" @(')E='5R;B!M
M87!P:6YG+F9I;F1&;W)W87)D*")F86EL=7)E(BD[#0H-"B @(" @("\O('=A
M<R!F;W)M(&-A;F-E;&QE9#\-"B @(" @(&EF("AI<T-A;F-E;&QE9"AR97%U
M97-T+"!M97-S86=E<RDI#0H@(" @(" @(')E='5R;B!G971,:7-T1F]R=V%R
M9"AD=D9O<FTL(&UA<'!I;F<I.PT*#0H@(" @(" O+R!E9&ET('1H92!C;VUP
M;W5N9"!B87-E9"!O;B!C:&%N9V5S(&)Y('1H92!U<V5R('1O('1H92!I;F9O
M<FUA=&EO;B!P<F5S96YT960@=&\@:&EM+VAE<@T*(" @(" @=')Y('L-"B @
M(" @(" @36]D96Q%9&ET06-C97-S(&UE82 ](&YE=PT*(" @(" @(" @(" @
M36]D96Q%9&ET06-C97-S*&=E=$1A=&%3;W5R8V4H<F5Q=65S="P@5&]K96XN
M5T0P,2DI.PT*(" @(" @("!M96$N961I=$-O;7!O=6YD*&1V1F]R;2YG971-
M87 H*2D[#0H@(" @("!]#0H@(" @("!C871C:" H36]D96Q!8V-E<W-%>&-E
M<'1I;VX@;6%E*2![#0H@(" @(" @(&5R<F]R<RYA9&0H06-T:6]N17)R;W)S
M+D=,3T)!3%]%4E)/4BP-"B @(" @(" @(" @(" @(" @("!N97<@06-T:6]N
M17)R;W(H(F5R<F]R<RYD871A8F%S92YE<G)O<B(L(&UA92YG971-97-S86=E
M*"DI*3L-"B @(" @(" @:68@*"%E<G)O<G,N:7-%;7!T>2@I*0T*(" @(" @
M(" @('-A=F5%<G)O<G,H<F5Q=65S="P@97)R;W)S*3L-"B @(" @(" @<F5T
M=7)N(&UA<'!I;F<N9FEN9$9O<G=A<F0H(F9A:6QU<F4B*3L-"B @(" @('T-
M"@T*(" @(" @+R\@9F]R=V%R9"!C;VYT<F]L('1O('1H92!A<'!R;W!R:6%T
M92!L:7-T(&9O<B!T:&4@961I=&5D(&-O;7!O=6YD#0H@(" @("!M97-S86=E
M<RYA9&0H06-T:6]N365S<V%G97,N1TQ/0D%,7TU%4U-!1T4L#0H@(" @(" @
M(" @(" @(" @(" @;F5W($%C=&EO;DUE<W-A9V4H(FUE<W-A9V5S+G=O<FMF
M;&]W+G-U8V-E<W,B*2D[#0H@(" @("!I9B H(6UE<W-A9V5S+FES16UP='DH
M*2D-"B @(" @(" @<V%V94UE<W-A9V5S*')E<75E<W0L(&UE<W-A9V5S*3L-
M"B @(" @(')E='5R;B!G971,:7-T1F]R=V%R9"AD=D9O<FTL(&UA<'!I;F<I
M.PT*(" @('T@96QS92![#0H@(" @("!E<G)O<G,N861D*$%C=&EO;D5R<F]R
M<RY'3$]"04Q?15)23U(L#0H@(" @(" @(" @(" @(" @(&YE=R!!8W1I;VY%
M<G)O<B@B97)R;W)S+G=O<FMF;&]W+F5R<F]R(BP@(F5D:71I;F<@8V]M<&]U
M;F0B*2D[#0H@(" @("!I9B H(65R<F]R<RYI<T5M<'1Y*"DI#0H@(" @(" @
M('-A=F5%<G)O<G,H<F5Q=65S="P@97)R;W)S*3L-"B @(" @(')E='5R;B!M
M87!P:6YG+F9I;F1&;W)W87)D*")F86EL=7)E(BD[#0H@(" @?0T*("!]#0H-
M"B @+RHJ#0H@("H@1&ES<&%T8V@@;65T:&]D('5S960@=&\@<F5A9"!A;B!E
M>&ES=&EN9R!C;VUP;W5N9"!I;B!T:&4@9&%T86)A<V4@=&\-"B @*B!P;W!U
M;&%T92!T:&4@9F]R;0T*(" J#0H@("H@0'!A<F%M(&UA<'!I;F<@4W1R=71S
M($%C=&EO;DUA<'!I;F<-"B @*B! <&%R86T@9F]R;2!3=')U=',@06-T:6]N
M1G)O;0T*(" J($!P87)A;2!R97%U97-T(')E<75E<W0@;V)J96-T#0H@("H@
M0'!A<F%M(')E<W!O;G-E(')E<W!O;G-E(&]B:F5C= T*(" J($!R971U<FX@
M06-T:6]N1F]R=V%R9 T*(" J+PT*("!P=6)L:6,@06-T:6]N1F]R=V%R9"!R
M96%D*$%C=&EO;DUA<'!I;F<@;6%P<&EN9RP-"B @(" @(" @(" @(" @(" @
M(" @(" @(" @("!!8W1I;VY&;W)M(&9O<FTL#0H@(" @(" @(" @(" @(" @
M(" @(" @(" @(" @2'1T<%-E<G9L971297%U97-T(')E<75E<W0L#0H@(" @
M(" @(" @(" @(" @(" @(" @(" @(" @2'1T<%-E<G9L971297-P;VYS92!R
M97-P;VYS92D@>PT*(" @($%C=&EO;D5R<F]R<R!E<G)O<G,@/2!N97<@06-T
M:6]N17)R;W)S*"D[#0H@(" @1'EN859A;&ED871O<D9O<FT@9'9&;W)M(#T@
M*$1Y;F%686QI9&%T;W)&;W)M*2!F;W)M.PT*#0H@(" @+R\@;6%K92!S=7)E
M('=E(&AA=F4@82!C;VUP;W5N9"!T;R!E9&ET#0H@(" @:68@*"%#;VUP;W5N
M9$ED+G-E=$-O;7!O=6YD260H<F5Q=65S="P-"B @(" @(" @(" @(" @(" @
M(" @(" @(" @(" @(" @("!E<G)O<G,L#0H@(" @(" @(" @(" @(" @(" @
M(" @(" @(" @(" @(" @<F5Q=65S="YG971087)A;65T97(H5&]K96XN0T]-
M4$]53D1)1"DI*2![#0H@(" @("!I9B H(65R<F]R<RYI<T5M<'1Y*"DI#0H@
M(" @(" @('-A=F5%<G)O<G,H<F5Q=65S="P@97)R;W)S*3L-"B @(" @(')E
M='5R;B!M87!P:6YG+F9I;F1&;W)W87)D*")F86EL=7)E(BD[#0H@(" @?0T*
M#0H@(" @+R\@<V%V92!T;VME;B!T;R!B92!I;F-L=61E9"!A<R!A(&AI9&1E
M;B!F;W)M(&9I96QD("AI;B!R97%U97-T*2!A;F0@:6X@<V5S<VEO;@T*(" @
M('-A=F54;VME;BAR97%U97-T*3L-"@T*(" @("\O(')E860@=&AE(&1A=&$@
M=&\@8F4@961I=&5D#0H@(" @=')Y('L-"B @(" @($UO9&5L4F5A9$%C8V5S
M<R!M<F$@/2!N97<-"B @(" @(" @("!-;V1E;%)E861!8V-E<W,H9V5T1&%T
M85-O=7)C92AR97%U97-T+"!4;VME;BY71# Q*2D[#0H-"B @(" @($UA<"!C
M;VUP;W5N9$UA<" ](&UR82YR96%D0V]M<&]U;F0H0V]M<&]U;F1)9"YG971#
M;VUP;W5N9$ED*')E<75E<W0I*3L-"@T*(" @(" @+R\@8V]P>2!O=7(@8G5S
M:6YE<W,@;V)J96-T("AA(&IA=F$N=71I;"Y-87 I('1O(&]U<B!F86YC>2!$
M>6YA5F%L:61A=&]R1F]R;0T*(" @(" @0F5A;E5T:6QS+G!O<'5L871E*&1V
M1F]R;2P@8V]M<&]U;F1-87 I.PT*(" @('T-"B @("!C871C:" H17AC97!T
M:6]N(&4I('L-"B @(" @(&5R<F]R<RYA9&0H06-T:6]N17)R;W)S+D=,3T)!
M3%]%4E)/4BP-"B @(" @(" @(" @(" @(" @;F5W($%C=&EO;D5R<F]R*")E
M<G)O<G,N9&%T86)A<V4N97)R;W(B+"!E+F=E=$UE<W-A9V4H*2DI.PT*(" @
M(" @:68@*"%E<G)O<G,N:7-%;7!T>2@I*0T*(" @(" @("!S879E17)R;W)S
M*')E<75E<W0L(&5R<F]R<RD[#0H-"B @(" @(')E='5R;B!M87!P:6YG+F9I
M;F1&;W)W87)D*")F86EL=7)E(BD[#0H@(" @?0T*#0H@(" @+R\@<V5N9"!T
M:&5M(&]F9B!T;R!T:&4@9F]R;0T*(" @(&1V1F]R;2YS970H5&]K96XN1$E3
M4$%40T@L(%1O:V5N+D5$250I.PT*(" @(')E='5R;B!M87!P:6YG+F9I;F1&
M;W)W87)D*")E9&ET1F]R;2(I.PT*("!]#0H-"@T*#0H@("\J*@T*(" @*B!2
M971U<FYS('1H92!A<'!R;W!R:6%T92!D97-T:6YA=&EO;B!F;W(@=&AE(&=I
M=F5N(&-O;7!O=6YD+@T*(" @*@T*(" @*B! <&%R86T@9'9&;W)M($1Y;F%6
M86QI9&%T;W)&;W)M#0H@(" J($!P87)A;2!M87!P:6YG($%C=&EO;DUA<'!I
M;F<-"B @("H@0')E='5R;B!!8W1I;VY&;W)W87)D('1O(&5I=&AE<B!A8W1I
M=F5#;VUP;W5N9',@;W(@:6YA8W1I=F5#;VUP;W5N9',-"B @("HO#0H@('!R
M;W1E8W1E9"!!8W1I;VY&;W)W87)D(&=E=$QI<W1&;W)W87)D*$1Y;F%686QI
M9&%T;W)&;W)M(&1V1F]R;2P-"B @(" @(" @(" @(" @(" @(" @(" @(" @
M(" @(" @(" @(" @(" @06-T:6]N36%P<&EN9R!M87!P:6YG*2![#0H@(" @
M<F5T=7)N("@H0F]O;&5A;BD@9'9&;W)M+F=E="A4;VME;BY!0U1)5D4I*2YB
M;V]L96%N5F%L=64H*2 _#0H@(" @(" @(" @;6%P<&EN9RYF:6YD1F]R=V%R
M9"@B86-T:79E0V]M<&]U;F1S(BD@.B!M87!P:6YG+F9I;F1&;W)W87)D*")I
;;F%C=&EV94-O;7!O=6YD<R(I.PT*("!]#0I]
`
end



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: DispatchAction descendant and Struts Validator problems

Posted by Tony Pinter <an...@pfizer.com>.
Just FYI, I found a post in the newsgroup archives that solved my problems.
The author's name eludes me, but he's certainly sharp.

All one must do is set validate to false for the action mapping in the
struts-config.xml and then, in the methods in which one wishes to validate,
call something like:

  protected boolean isFormValid(HttpServletRequest request,
                                ActionMapping mapping,
                                ActionErrors errors,
                                ActionForm form) {
    DynaValidatorForm dvForm = (DynaValidatorForm) form;

    errors.add(dvForm.validate(mapping, request));
    if (!errors.isEmpty()) {
      saveErrors(request, errors);
      return false;
    } else return true;
  }
}

Simple fix from a very helpful newsgroup,
Tony




---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org