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>&nbsp;&nbsp;&nbsp; public Object invoke(MethodInvocation invocation) throws Throwable {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println(&quot;before&quot;);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Object ret = invocation.proceed();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println(&quot;after&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return ret;<br>&nbsp;&nbsp;&nbsp; }<br>}<br><br>$B#3!%(Baoptest.dicon$B:n@.(B<br>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br>
&lt;!DOCTYPE components PUBLIC &quot;-//SEASAR//DTD S2Container 2.4//EN&quot;<br>&nbsp;&nbsp;&nbsp; &quot;<a href="http://www.seasar.org/dtd/components24.dtd">http://www.seasar.org/dtd/components24.dtd</a>&quot;&gt;<br>&lt;components&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;component class=&quot;java.util.Date&quot;&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;aspect pointcut=&quot;getTime&quot;&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;component class=&quot;sastruts.interceptor.MyInterceptor&quot;/&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/aspect&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;/component&gt;<br>&lt;/components&gt;<br><br>$B#4!%(Bapp.dicon$B$G(Baoptest.dicon$B%$%s%/%k!<%I(B<br>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br>&lt;!DOCTYPE components PUBLIC &quot;-//SEASAR//DTD S2Container 2.4//EN&quot;<br>
&nbsp;&nbsp;&nbsp; &quot;<a href="http://www.seasar.org/dtd/components24.dtd">http://www.seasar.org/dtd/components24.dtd</a>&quot;&gt;<br>&lt;components&gt;<br>&nbsp; &lt;include path=&quot;convention.dicon&quot;/&gt;<br>&nbsp; &lt;include path=&quot;aop.dicon&quot;/&gt;<br>
&nbsp; &lt;include path=&quot;j2ee.dicon&quot;/&gt;<br>&nbsp; &lt;include path=&quot;s2jdbc.dicon&quot;/&gt;<br>&nbsp; &lt;include path=&quot;aoptest.dicon&quot;/&gt;<br>&nbsp; &lt;component name=&quot;actionMessagesThrowsInterceptor&quot; class=&quot;org.seasar.struts.interceptor.ActionMessagesThrowsInterceptor&quot;/&gt;<br>
&lt;/components&gt;<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>&nbsp;&nbsp;&nbsp; @Execute(validator = false)<br>&nbsp;&nbsp;&nbsp; public String index() throws Exception {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Date date = new Date();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; date.getTime();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return &quot;index.jsp&quot;;<br>&nbsp;&nbsp;&nbsp; }<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 &lt;<a href="mailto:conpota@gmail.com">conpota@gmail.com</a>&gt;<br>