簡介
在Struts
Interceptor stack是由多個攔截器組成的攔截器組
實例
在這個實例當中
package interceptor;
import com
import com
/** *//**
*author by ;
*/
public class ActionTimer implements Interceptor{
public String intercept(ActionInvocation next) throws Exception {
long t
String s= next
long t
System
return s;
}
public void init() {
}
public void destroy() {
}
}
struts
<?xml version=
<!DOCTYPE struts PUBLIC
<struts>
<package name=
<interceptors>
<interceptor name=
class=
<interceptor
<interceptor
<interceptor
</interceptor
</interceptors>
<default
<action name=
class=
<result>;/interceptor/interceptordemo
</action>
</package>
</struts>
interceptordemo
<html>
<head>
</head>
<body>
</body>
</html>
From:http://tw.wingwit.com/Article/program/Java/ky/201311/28890.html