conpota$B$H?=$7$^$9!#(B<br><br>AOP$B$rJY6/$7$F$$$^$9$,!"4JC1$J%5%s%W%k$bF0$+$9$3$H$,$G$-$^$;$s!#(B<br>$B0J2<$N$h$&$J46$8$G:n$j$^$7$?$,!"$I$3$,$$$1$J$$$G$7$g$&$+!)(B<br><br>$B#1!%(Bdolteng0.36.0$B$G(Bsastruts+s2jdbc$B$G%W%m%8%'%/%H$r:n@.(B<br><br>$B#2!%%$%s%?!<%;%W%?:n@.(B<br>package sastruts.interceptor;<br>import org.aopalliance.intercept.MethodInvocation;<br>
import org.seasar.framework.aop.interceptors.AbstractInterceptor;<br>public class MyInterceptor extends AbstractInterceptor {<br> public Object invoke(MethodInvocation invocation) throws Throwable {<br> System.out.println("before");<br>
Object ret = invocation.proceed();<br> System.out.println("after");<br> return ret;<br> }<br>}<br><br>$B#3!%(Baoptest.dicon$B:n@.(B<br><?xml version="1.0" encoding="UTF-8"?><br>
<!DOCTYPE components PUBLIC "-//SEASAR//DTD S2Container 2.4//EN"<br> "<a href="http://www.seasar.org/dtd/components24.dtd">http://www.seasar.org/dtd/components24.dtd</a>"><br><components><br>
<component class="java.util.Date"><br> <aspect pointcut="getTime"><br> <component class="sastruts.interceptor.MyInterceptor"/><br> </aspect><br>
</component><br></components><br><br>$B#4!%(Bapp.dicon$B$G(Baoptest.dicon$B%$%s%/%k!<%I(B<br><?xml version="1.0" encoding="UTF-8"?><br><!DOCTYPE components PUBLIC "-//SEASAR//DTD S2Container 2.4//EN"<br>
"<a href="http://www.seasar.org/dtd/components24.dtd">http://www.seasar.org/dtd/components24.dtd</a>"><br><components><br> <include path="convention.dicon"/><br> <include path="aop.dicon"/><br>
<include path="j2ee.dicon"/><br> <include path="s2jdbc.dicon"/><br> <include path="aoptest.dicon"/><br> <component name="actionMessagesThrowsInterceptor" class="org.seasar.struts.interceptor.ActionMessagesThrowsInterceptor"/><br>
</components><br><br>$B#5!%(BIndexAction$B$r=$@5(B<br>package sastruts.action;<br>import java.util.Date;<br>import org.seasar.struts.annotation.Execute;<br>public class IndexAction {<br> @Execute(validator = false)<br> public String index() throws Exception {<br>
Date date = new Date();<br> date.getTime();<br> return "index.jsp";<br> }<br>}<br><br><a href="http://localhost:8080/sastruts/">http://localhost:8080/sastruts/</a>$B$K%"%/%;%9$7$F$b(BMyInterceptor$B$N(Binvoke$B%a%=%C%I$,8F$P$l$^$;$s!#(B<br>
<br>$B$h$m$7$/$*4j$$CW$7$^$9!#(B<br clear="all"><br>-- <br>conpota <<a href="mailto:conpota@gmail.com">conpota@gmail.com</a>><br>