<div>$B55ED$H?=$7$^$9!#(B</div>
<div>$B=i$a$FEj9F$7$^$9!#(B</div>
<div>$B59$7$/$*4j$$$7$^$9!#(B</div>
<p>AOP$B$K$h$kG'>Z%A%'%C%/$N%5%s%W%k$r:n$C$F$$$^$9!#(B<br>S2Container$B$H(BTeeda$B$N%P!<%8%g%s$rJQ99$7$?$i!"(B<br>$B%W%m%0%i%`$,@5>o$KF0:n$7$J$/$J$j!"860x$,J,$+$j$^$;$s!#(B<br>$B3'MM$N$465<($r;r$j$?$/Ej9F$7$^$7$?!#(B</p>
<p>$B"#4D6-(B1(S2Container-2.4.10$B$H(BTeeda-1.0.4)<br> s2-extension-2.4.10.jar,s2-framework-2.4.10.jar,s2-tiger-2.4.10.jar<br> teeda-core-1.0.4.jar,teeda-extension-1.0.4.jar,teeda-tiger-1.0.4.jar<br> $BB>B??t(B</p>
<p>$B"#4D6-(B2(S2Container-2.4.13$B$H(BTeeda-1.0.7)<br>$B!!(Bs2-extension-2.4.13.jar,s2-framework-2.4.13.jar,s2-tiger-2.4.13.jar<br>$B!!(Bteeda-ajax-1.0.7.jar,teeda-core-1.0.7.jar,teeda-extension-1.0.7.jar,teeda-tiger-1.0.7.jar<br> $BB>B??t(B</p>
<p>$B"#%W%m%0%i%`9=@.(B<br> LoginInterceptor2.java<br> LoginUserDto.java @Component(instance = InstanceType.SESSION)$B$G(B<br>$B!!!!!!!!!!!!!!!!!!!!!!(B $B%;%C%7%g%s$KJ]4I(B <br>$B!!(Blogin2.html ---->Login2Page.java<br> $B%m%0%*%U$O(B@RemoveSession(name="loginUserDto")
<br> logincheck2.html---->Logincheck2Page.java</p>
<p>$B"#%F%9%H$N35MW(B<br>$B!!!&(Blogin2.html$B$GF~NO$7$?%m%0%$%s>pJs$r(BLogin2Page$B$G%A%'%C%/$7(B<br>$B!!!!7k2L$r(BLoginUserDto$B$K%;%C%H$7!"%;%C%7%g%s$KJ]4I$7$^$9!#(B<br> $B!&(Blogincheck2.html$B$O%F%9%HMQ(Bhtml$B$G!"2hLL>e$N(Bsubmit$B%\%?%s$r(B<br>$B!!!!2!2<$9$k$H(BLogincheck2Page$B$N(BdoAuth()$B%a%=%C%I$r8F$S=P$7$^$9!#(B<br>$B!!!&(BdoAuth()$B%a%=%C%I$K$O(BAOP$B$,E,MQ$5$l$F$*$j!"(BLoginInterceptor2$B$,(B
<br>$B!!!!(BLoginUserDto$B$N%m%0%$%s>pJs$r%A%'%C%/$7!"G'>Z(BOK$B$H%(%i!<$K(B<br>$B!!!!BP1~$7$F2hLL$KA+0\$7$^$9!#(B</p>
<p>$B"#4D6-(B1$B$O@5>o$KF0:n$7$^$9!#(B</p>
<p>$B"#4D6-(B2$B$N>l9g!"(B<br> 1.LoginInterceptor2$B$K(BLoginUserDto$B$,(BDI$B$5$l$J$$(B(null)$B$?$a!">o$KG'>Z%(%i!<$K$J$j$^$9(B<br>$B!!!!(BLogincheck2Page$B$K$O(BDI$B$5$l$^$9(B<br> 2.Login2Page$B$N%m%0%*%U$G(BLoginUserDto$B$,%;%C%7%g%s$+$i:o=|$5$l$^$;$s(B<br> @RemoveSession(name="loginUserDto")$B$,Mx$+$J$$(B</p>
<p>$B"#%=!<%9(B</p>
<p>$B!Z(BLoginInterceptor2$B![(B<br>package test.interceptor;</p>
<p>$B!D(B $B>JN,(B $B!D(B</p>
<p>public class LoginInterceptor2 implements MethodInterceptor {</p>
<p> private LoginUserDto loginUserDto;</p>
<p> public void setLoginUserDto(LoginUserDto loginUserDto){ this.loginUserDto = loginUserDto; }</p>
<p> public Object invoke(MethodInvocation invocation) throws Throwable {</p>
<p> if(loginUserDto!=null){<br> if(loginUserDto.isAuthed()){<br> System.out.println("@@@@@@@@@ $BA0(B");<br> Object obj = invocation.proceed();<br> System.out.println("@@@@@@@@@ $B8e(B");
<br> return obj;<br> }<br> }<br> return "error";<br> }<br>}</p>
<p>$B!Z(BLoginUserDto$B![(B<br>package test.web.dto;<br>import org.seasar.framework.container.annotation.tiger.*;</p>
<p>@Component(instance = InstanceType.SESSION)<br>public class LoginUserDto {<br> private String userId; <br> private boolean authed; <br> public String getUserId() { return userId; }
<br> public void setUserId(String userId) { this.userId = userId; }<br> public boolean isAuthed() { return authed; }<br> public void setAuthed(boolean authed) { this.authed = authed; }
<br>}</p>
<p>$B!Z(BLogin2Page$B![(B</p>
<p>package test.web.login2;</p>
<p>$B!D(B $B>JN,(B $B!D(B</p>
<p>public class Login2Page {</p>
<p> private String userId;<br> private String password;<br> private boolean loggedin=true;<br> private String loginMsg = "$B=i4|%a%C%;!<%8(B";</p>
<p> private LoginUserDto loginUserDto;<br> <br> $B!D(B $B>JN,(B $B!D(B(setter/getter)</p>
<p> public void setLoginUserDto(LoginUserDto loginUserDto) {<br> this.loginUserDto = loginUserDto;<br> }</p>
<p> public String doLogin() {<br> System.out.println("#### start doLogin() ####");<br> if(userId.equals("user") && password.equals("user")) {<br> loginUserDto.setAuthed(true);
<br> loginUserDto.setUserId(userId);<br> loginMsg = "$B%m%0%$%s@.8y(B";<br> loggedin = true;<br> return "success";<br> } else {<br> loginUserDto.setAuthed(false);<br> loginMsg = "$B%m%0%$%s<:GT(B";
<br> loggedin = false;<br> return "error";<br> }<br> <br> }</p>
<p> @RemoveSession(name="loginUserDto")<br> public String doLogout() {<br> System.out.println("#### start doLogout() ####");<br> return null;<br> }</p>
<p> public String prerender() {<br> System.out.println("#### start prerender() ####");</p>
<p> if(loginUserDto.isAuthed()) {<br> loggedin = true;<br> } else {<br> loggedin = false;<br> }<br> return null;<br> }<br>}</p>
<p>$B!Z(BLogincheck2Page$B![(B</p>
<p>package test.web.logincheck2;</p>
<p>$B!D(B $B>JN,(B $B!D(B</p>
<p>public class Logincheck2Page {</p>
<p>$B!D(B $B>JN,(B $B!D(B</p>
<p> private LoginUserDto loginUserDto;<br> public void setLoginUserDto(LoginUserDto loginUserDto){ <br> his.loginUserDto = loginUserDto ;<br> }</p>
<p> public String initialize(){<br> System.out.println("##### Start initialize() #####");<br> statMsg="$B%m%0%$%s>5G'L$:Q(B";<br> if(loginUserDto!=null){<br> if(loginUserDto!=null){<br> if(loginUserDto.isAuthed
()){<br> statMsg="$B%m%0%$%s>5G':Q$_(B";<br> }<br> }<br> }<br> return null;<br> }<br> public String doAuth() {<br> System.out.println("##### Start doAuth() #####");<br> return null;
<br> }<br>}</p>
<p> </p>
<p><br> </p>