[Seasar-user:22104] Re: @Requiredで指定したプロパティの値がnullになる事象
shibata
[E-MAIL ADDRESS DELETED]
2015年 9月 16日 (水) 23:42:31 JST
$B?=$7Lu$"$j$^$;$s!#(B
$B4V0c$$$,$"$j$^$7$?$N$GD{@5$7$^$9!#(B
$B9=@.$O2<5-$N$h$&$K$J$C$F$$$^$9!#(B
$B"(=j!9>JN,$7$F$$$^$9$,$4MF<O$/$@$5$$!#(B
/view/test/test.html
<form id="testForm">
<input type="text" id="serialNo" />
<input type="submit" id="doOnceTest" value="$B%F%9%H(B"/>
</html>
package jp.co.sample.web.test;
public abstract class TestPage {
@Required(target="doOnceTest")
public String serialNo;
public abstract Class<?> doOnceTest();
}
package jp.co.sample.web.test.impl;
public class TestPageImpl extends TestPage {
@Binding(bindingType=BindingType.MUST)
public TestService testService;
@Override
public Class<?> doOnceTest() {
testService.checkKey(this);
}
}
package jp.co.sample.service;
public interface TestService {
public boolean checkKey(TestPage page);
}
package jp.co.sample.service.impl;
public class TestServiceImpl implements TestService {
@Override
public boolean checkKey(TestPage page){
page.serialNo = page.serialNo.toUpperCase();$B!!"+$3$3$G(BNullPointerException$B$,H/@8(B
$B!&(B
$B!&(B
$B!&(B
}
}
On 2015/09/16 23:37, shibata wrote:
> $B<FED$H?=$7$^$9!#(B
> $B$$$D$b$*@$OC$K$J$C$F$*$j$^$9!#(B
>
> $B0JA0!"(B[Seasar-user:21779]$B$G<ALd$5$;$FD:$$$?FbMF$H$O0[$J$j$^$9$,!"(B
> $BJL$NFbMF$GITDj4|$KH/@8$9$k;v>]$,$"$j!"$4O"Mm$5$;$FD:$-$^$7$?!#(B
> $B:#2s$b:F8=<j=g$,$"$j$^$;$s!#(B
> $B2?$+5$$K$J$kE@$d3NG'$9$k%]%$%s%H$J$I65$($FD:$1$l$P9,$$$G$9!#(B
>
> $B"#;HMQ$7$F$$$k%P!<%8%g%s(B
> $B!!(Bteeda-ajax-1.0.13-sp11.jar
> $B!!(Bteeda-core-1.0.13-sp11.jar
> $B!!(Bteeda-extension-1.0.13-sp11.jar
> $B!!(Bteeda-tiger-1.0.13-sp11.jar
> $B!!(Bs2-extension-2.4.45.jar
> $B!!(Bs2-framework-2.4.45.jar
> $B!!(Bs2-tiger-2.4.45.jar
>
> $B"#H/@8$7$F$$$k;v>](B
> $B!!-!%Z!<%8%/%i%9$G$"$k%W%m%Q%F%#$K(B @ Required$B$r;XDj!J$3$N;~!"FCDj$N(Btarget$B$r;XDj!K(B
> $B!!-"-!$G;XDj$7$?(Btarget$B$,<B9T$5$l!"(BService$B%/%i%9$r8F$S=P$7(B
> $B!!-#-"$G8F$S=P$5$l$?(BService$B%/%i%9$G-!$N%W%m%Q%F%#$r;2>H$9$k$H(Bnull$B$K$J$C$F$$$k!#(B
>
> $B!!(B[Seasar-user:13427] $B$NFbMF$H6a$$$H;W$C$?$N$G$9$,!"(B
> $B!!:#2s$N;v>]$O(BdoXXX$B$GH/@8$7$F$*$j$^$9!#2?$+4X78$,$"$k$N$G$7$g$&$+!)(B
>
> $B9=@.$O2<5-$N$h$&$K$J$C$F$$$^$9!#(B
> $B"(=j!9>JN,$7$F$$$^$9$,$4MF<O$/$@$5$$!#(B
>
> /view/test/test.html
> <form id="testForm">
> <input type="text" id="aaa" />
> <input type="submit" id="doOnceTest" value="$B%F%9%H(B"/>
> </html>
>
>
> package jp.co.sample.web.test;
> public abstract class TestPage {
> @Required(target="doOnceTest")
> public String serialNo;
>
> public abstract Class<?> doOnceTest();
> }
>
> package jp.co.sample.web.test.impl;
> public class TestPageImpl extends TestPage {
> @Binding(bindingType=BindingType.MUST)
> public TestService testService;
>
> @Override
> public Class<?> doOnceTest() {
> testService.checkKey(this);
> }
> }
>
> package jp.co.sample.service;
> public interface TestService {
> public boolean checkKey(TestPage page);
> }
>
> package jp.co.sample.service.impl;
> public class TestServiceImpl implements TestService {
> @Override
> public boolean checkKey(TestPage page){
> page.serialNo = page.serialNo.toUpperCase();$B!!"+$3$3$G(BNullPointerException$B$,H/@8(B
> $B!&(B
> $B!&(B
> $B!&(B
> }
> }
>
> $B2?$+5$$K$J$kE@$,$4$6$$$^$7$?$i%3%a%s%H$r$*4j$$CW$7$^$9!#(B
>
> $B0J>e!"$h$m$7$/$*4j$$CW$7$^$9!#(B
>
>
>
> _______________________________________________
> Seasar-user mailing list
> Seasar-user @ ml.seasar.org
> https://ml.seasar.org/mailman/listinfo/seasar-user
>
--
-----------------------------------------------------------------
$B!!%O%K%+%`%&%(%"3t<02q<R(B
$B!!!!!!<FED(B $B9/;V(B
$B!!!!!!!!(BE-mail : shibata @ honeycomware.jp
$B!!!!!!!!(BTEL/FAX: 045-228-8610 / 045-228-8611
$B!!!!!!!!=;=j(B : $B")(B231-0006
$B!!!!!!!!!!!!!!!!(B $B2#IM;TCf6hFnCgDL(B 4-49 $BJ!5W%S%k(B 8F-A
$B!!!!!!!!(BMobile : 080-4407-4641
$B!!(B<$B%5%]!<%HAk8}(B>
$B!!!!$*Ld$$9g$o$;Ak8}!'(Bsupport @ honeycomware.jp
$B!!!!<uIU;~4V(B $B7n!A6b(B $B!'(B9:00$B!A(B17:30 $BEZF|=KF|=|$/(B
-----------------------------------------------------------------
$B%a%k%^%,$O$8$a$^$7$?!#@'Hs2<5-$h$j$4EPO?$/$@$5$$!#(B
$BF|4)!X%;%-%e%j%F%#B.Js!z$^$H$aDL?.!Y(B
$B!A$"$J$?$N2q<R!"%;%-%e%j%F%#4XO"$N>pJs<}=8$OK|A4$G$9$+!)!A(B
http://www.mag2.com/m/0001655545.html
-----------------------------------------------------------------
$B$3$NEE;R%a!<%k!JE:IU%U%!%$%kEy$r4^$`!K$O!"0U?^$7$?Aj<j$KAw?.$7$?(B
$B$b$N$G$"$j!"HkF?!"FC8"$NBP>]$K$J$k>pJs$r4^$s$G$$$k>l9g$,$"$j$^$9!#(B
$B$b$7!"0U?^$7$?Aj<j0J30$NJ}$,<u?.$5$l$?>l9g$O!"Aw?.85$X$4O"MmD:$/(B
$B$H$H$b$K!"$3$N%a!<%k$r:o=|D:$-!"0l @ Z$N3+<(!"J#<L!"G[I[!"$=$NB>$N(B
$BMxMQ9T0Y$r$5$l$J$$$h$&$*4j$$CW$7$^$9!#(B
-----------------------------------------------------------------
Seasar-user メーリングリストの案内