[Seasar-user:7345] Re: メソッドごとのValidationについて(S2Struts)

Katsuhiko Nagashima [E-MAIL ADDRESS DELETED]
2007年 4月 19日 (木) 08:43:28 JST


$B1JEg$G$9!#(B

> $B$3$NJ}K!$G>-MhE*$KLdBj$,$"$j$=$&$G$7$?$i!"65$($F$$$?$@$1$J$$$G$7$g$&$+!#(B
> $BFC$K(Bs2struts:submit$B%?%0$N(Bproperty$[E-MAIL ADDRESS DELETED]$r;XDj$7$F$$$k$N$G$9$,!"(B
> $BLdBj$J$$$7$g$&$+!#(B

$B:#2s$NMxMQJ}K!$G$OLdBj$"$j$^$;$s!#(B

submit$B%?%0$G<B9T$9$k(Baction$B$O!"(BS2Struts$BFb$G4IM}$7$F$^$9!#(B
submit$B%?%0$G(Bproperty$[E-MAIL ADDRESS DELETED]$r;XDj$9$k>l9g!"(B
   form$B%?%0Fb$G;XDj$7$?(BActionMapping$BL>(B + property$[E-MAIL ADDRESS DELETED]$NCM(B + value$B$H$J$kCM(B
$B$r(BKey$B$H$7$F<B9T$9$k(Baction$B$H7k$SIU$1$F4IM}$7$F$$$^$9!#(B
$B$G$9$N$G!"(B
1$B$D$N(Bform$B%?%0Fb$G(Bsubmit$B%?%0$N(Bproperty$[E-MAIL ADDRESS DELETED]$H(Bvalue$B$H$J$kCM$,(B
$BF1$8$G(Baction$[E-MAIL ADDRESS DELETED]$,0[$J$k>l9g$O!"(B
$B8e$KDj5A$5$l$?(Bsubmit$B%?%0$N(Baction$[E-MAIL ADDRESS DELETED]$N$_$,M-8z$H$J$j!"(B
$B4|BT$7$?F0$-$H$O0[$J$k$3$H$K$J$k$H;W$$$^$9!#(B
$BNc$($P!"0J2<$N$h$&$J>l9g$G$9!#(B
---
<html:form action="/department">
   <s2struts:submit action="#{departmentAction.goSearch}"
       property="command" >go</s2struts:submit>
   <s2struts:submit action="#{departmentAction.goUpdate}"
       property="command" >go</s2struts:submit>
</html:form>
---

$B$?$@!":#2s$NMxMQJ}K!$G$O!">e5-$N$h$&$JNc$N$D$/$j$K$O(B
$B$J$i$J$$$N$G$O$J$$$+$H;W$$$^$9$N$G!"LdBj$J$/MxMQ$G$-$^$9!#(B


> $BJ8;z2=$1$7$F$$$?$h$&$J$N$G!"(B
> $B:FEY%a!<%k$5$;$F$$$?$@$$$F$$$k$N$G$9$,!"(B
> $B$^$?2=$1$F$$$?$i!"?=$7Lu$4$6$$$^$;$s!#(B

$BA02s$N$b;d$N4D6-$G$OJ8;z2=$1$;$:$K8+$k$3$H$,$G$-$^$7$?!#(B
$BJV?.$,CY$/$J$j$9$_$^$;$s!#(Bm(_ _)m

$B0J>e$G$9!#(B

07/04/18 $B$K(B Ogino Yosihko<[E-MAIL ADDRESS DELETED]> $B$5$s$O=q$-$^$7$?(B:
> $B$$$D$b$*@$OC$K$J$C$F$*$j$^$9!#(B
> $B2.Ln$H?=$7$^$9!#(B
>
> $B2?EY$b?=$7Lu$4$6$$$^$;$s!#(B
> $BJ8;z2=$1$7$F$$$?$h$&$J$N$G!"(B
> $B:FEY%a!<%k$5$;$F$$$?$@$$$F$$$k$N$G$9$,!"(B
> $B$^$?2=$1$F$$$?$i!"?=$7Lu$4$6$$$^$;$s!#(B
>
>
> s2Struts$B%?%0!"(BStruts$B$N(Bvalidation.xml$B$r;H$C$F!"(B
> $B%a%=%C%I$4$H$N(BValidation$B$r9T$*$&$H$7$F$$$^$9!#(B
>
> $B0J2<$NJ}K!$G!"$G$-$?$N$G$9$,!"LdBj$J$$$G$7$g$&$+!#(B
>
> $B#1!%(BActionForm
> $B-!(Borg.apache.struts.validator.ValidatorForm $B$r7Q>5$7$?(BActionForm$B$r:[E-MAIL ADDRESS DELETED](B
> $B-"(Bcommand$B%W%m%Q%F%#$rDj5A(B
> $B-#(BgetValidationKey()$B%a%=%C%I$NDI2C(B
>
> public class DepartmentForm extends ValidatorForm{
> $B!&!&!&!&!&(B      protected String command;
>    public String getCommand() {
>        return command;
>    }
>    public void setCommand(String command)
>    {
>        this.command = command;
>    }
>    public String getValidationKey(ActionMapping mapping, HttpServletRequest
> request) {
>       return super.getValidationKey(mapping, request) + "_" + this.command;
>
>    }
>
> $B#2!%(BAction$BDj?t%"%N%F!<%7%g%s$[E-MAIL ADDRESS DELETED](B
>
> public static final String ACTION = "name=departmentForm,
>  scope=request,   parameter=command, validate=true ,
> input=error.jsp ";
>
> $B#3!%(Bvalidation.xml$B$[E-MAIL ADDRESS DELETED](B
> Form$BL>$N8e$K%\%?%sL>$[E-MAIL ADDRESS DELETED](B
>
> <form name="departmentForm_Search">
>        <field  property="deptId" depends="required">
>            <arg0 key="$BIt=p(BID" resource="false" />
>        </field>
> </form>
> <form name="departmentForm_Update">
>        <field  property="deptId"  depends="mask">
>            <arg0 key="$BIt=p(BID" resource="false" />
>            <var>
>                <var-name>mask</var-name>
>                <var-value>^[0-9a-zA-Z]*$</var-value>
>            </var>
>    </field>
> </form>
>
> $B#4!%(BJSP
> <s2struts:submit action="#{departmentAction.goSearch}"
> property="command" >
> Search</s2struts:submit>
> <s2struts:submit action="#{departmentAction.goUpdate}"
> property="command" >
> Update</s2struts:submit>
>
>
> $B$3$NJ}K!$G>-MhE*$KLdBj$,$"$j$=$&$G$7$?$i!"65$($F$$$?$@$1$J$$$G$7$g$&$+!#(B
> $BFC$K(Bs2struts:submit$B%?%0$N(Bproperty$[E-MAIL ADDRESS DELETED]$r;XDj$7$F$$$k$N$G$9$,!"(B
> $BLdBj$J$$$7$g$&$+!#(B
>
> $BB>$K$*A&$a$9$kJ}K!$,$"$j$^$7$?$i!"(B
> $B$465<x$$$?$@$1$k$H!"$"$j$,$?$$$G$9!#(B
>
> $B$*<j?t$G$9$,!"$h$m$7$/$*4j$$CW$7$^$9!#(B
>
> _________________________________________________________________
> $B%a%C%;%s%8%c!<H/%"%$%I%k$H$N%3%i%\<L??=8$r%A%'%C%/(B
> http://campaign.live.jp/dizon/
>
>
> _______________________________________________
> Seasar-user mailing list
> [E-MAIL ADDRESS DELETED]
> https://ml.seasar.org/mailman/listinfo/seasar-user
>
>


-- 
Katsuhiko Nagashima


Seasar-user メーリングリストの案内