<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>&nbsp; s2-extension-2.4.10.jar,s2-framework-2.4.10.jar,s2-tiger-2.4.10.jar<br>&nbsp; teeda-core-1.0.4.jar,teeda-extension-1.0.4.jar,teeda-tiger-1.0.4.jar<br>&nbsp; $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>&nbsp; $BB>B??t(B</p>
<p>$B"#%W%m%0%i%`9=@.(B<br>&nbsp; LoginInterceptor2.java<br>&nbsp; LoginUserDto.java&nbsp;&nbsp;&nbsp; @Component(instance = InstanceType.SESSION)$B$G(B<br>$B!!!!!!!!!!!!!!!!!!!!!!(B $B%;%C%7%g%s$KJ]4I(B&nbsp; <br>$B!!(Blogin2.html&nbsp;&nbsp;&nbsp;&nbsp; ----&gt;Login2Page.java<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $B%m%0%*%U$O(B@RemoveSession(name=&quot;loginUserDto&quot;)
<br>&nbsp; logincheck2.html----&gt;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>&nbsp; $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>&nbsp; 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>&nbsp; 2.Login2Page$B$N%m%0%*%U$G(BLoginUserDto$B$,%;%C%7%g%s$+$i:o=|$5$l$^$;$s(B<br>&nbsp;&nbsp;&nbsp; @RemoveSession(name=&quot;loginUserDto&quot;)$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>&nbsp; private LoginUserDto loginUserDto;</p>
<p>&nbsp; public void setLoginUserDto(LoginUserDto loginUserDto){ this.loginUserDto = loginUserDto; }</p>
<p>&nbsp; public Object invoke(MethodInvocation invocation) throws Throwable {</p>
<p>&nbsp;&nbsp;&nbsp; if(loginUserDto!=null){<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(loginUserDto.isAuthed()){<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println(&quot;@@@@@@@@@ $BA0(B&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Object obj = invocation.proceed();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println(&quot;@@@@@@@@@ $B8e(B&quot;);
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return obj;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; return &quot;error&quot;;<br>&nbsp; }<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>&nbsp; private String userId;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp; private boolean authed;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp; public String&nbsp; getUserId()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { return userId;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
<br>&nbsp; public void&nbsp;&nbsp;&nbsp; setUserId(String userId)&nbsp;&nbsp;&nbsp; { this.userId = userId;&nbsp;&nbsp; }<br>&nbsp; public boolean isAuthed()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { return authed;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp; public void&nbsp;&nbsp;&nbsp; setAuthed(boolean authed)&nbsp;&nbsp; { this.authed = authed;&nbsp;&nbsp; }
<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>&nbsp; private String&nbsp; userId;<br>&nbsp; private String&nbsp; password;<br>&nbsp; private boolean loggedin=true;<br>&nbsp; private String&nbsp; loginMsg = &quot;$B=i4|%a%C%;!<%8(B&quot;;</p>
<p>&nbsp; private LoginUserDto loginUserDto;<br>&nbsp;<br>&nbsp;$B!D(B $B>JN,(B $B!D(B(setter/getter)</p>
<p>&nbsp; public void&nbsp;&nbsp;&nbsp; setLoginUserDto(LoginUserDto loginUserDto) {<br>&nbsp;&nbsp;&nbsp; this.loginUserDto = loginUserDto;<br>&nbsp; }</p>
<p>&nbsp; public String doLogin() {<br>&nbsp;&nbsp;&nbsp; System.out.println(&quot;#### start doLogin() ####&quot;);<br>&nbsp;&nbsp;&nbsp; if(userId.equals(&quot;user&quot;) &amp;&amp; password.equals(&quot;user&quot;)) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; loginUserDto.setAuthed(true);
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; loginUserDto.setUserId(userId);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; loginMsg = &quot;$B%m%0%$%s@.8y(B&quot;;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; loggedin = true;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return &quot;success&quot;;<br>&nbsp;&nbsp;&nbsp; } else {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; loginUserDto.setAuthed(false);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; loginMsg = &quot;$B%m%0%$%s<:GT(B&quot;;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; loggedin = false;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return &quot;error&quot;;<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;<br>&nbsp; }</p>
<p>&nbsp; @RemoveSession(name=&quot;loginUserDto&quot;)<br>&nbsp; public String doLogout() {<br>&nbsp;&nbsp;&nbsp; System.out.println(&quot;#### start doLogout() ####&quot;);<br>&nbsp;&nbsp;&nbsp; return null;<br>&nbsp; }</p>
<p>&nbsp; public String prerender() {<br>&nbsp;&nbsp;&nbsp; System.out.println(&quot;#### start prerender() ####&quot;);</p>
<p>&nbsp;&nbsp;&nbsp; if(loginUserDto.isAuthed()) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; loggedin = true;<br>&nbsp;&nbsp;&nbsp; } else {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; loggedin = false;<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; return null;<br>&nbsp; }<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>&nbsp; private LoginUserDto loginUserDto;<br>&nbsp; public void setLoginUserDto(LoginUserDto loginUserDto){ <br>&nbsp;&nbsp;&nbsp; his.loginUserDto = loginUserDto ;<br>&nbsp; }</p>
<p>&nbsp; public String initialize(){<br>&nbsp;&nbsp;&nbsp; System.out.println(&quot;##### Start initialize() #####&quot;);<br>&nbsp;&nbsp;&nbsp; statMsg=&quot;$B%m%0%$%s>5G'L$:Q(B&quot;;<br>&nbsp;&nbsp;&nbsp; if(loginUserDto!=null){<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(loginUserDto!=null){<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(loginUserDto.isAuthed
()){<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; statMsg=&quot;$B%m%0%$%s>5G':Q$_(B&quot;;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; return null;<br>&nbsp; }<br>&nbsp; public String doAuth() {<br>&nbsp;&nbsp;&nbsp; System.out.println(&quot;##### Start doAuth() #####&quot;);<br>&nbsp;&nbsp;&nbsp; return null;
<br>&nbsp; }<br>}</p>
<p>&nbsp;</p>
<p><br>&nbsp;</p>