myinterceptor.java
来自「利用struts2的验证框架」· Java 代码 · 共 32 行
JAVA
32 行
package com.test.interceptor;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.Interceptor;
public class MyInterceptor implements Interceptor {
public String hello;
public void setHello(String hello) {
this.hello = hello;
}
public void destroy() {
System.out.println("destroy()...");
}
public void init() {
System.out.println("init()...");
System.out.println(hello);
}
public String intercept(ActionInvocation invocation) throws Exception {
System.out.println("intercept()...");
String result = invocation.invoke();
return result;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?