import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
import org.apache.struts2.ServletActionContext;
import javax.servlet.http.HttpSession;
/**
* 文件名称: LogInterceptor.java
* 编写人: yh.zeng
* 编写时间: 17-1-18 下午1:26
* 文件描述: todo
*/
public class LogInterceptor extends AbstractInterceptor
{
@Override
public String intercept(ActionInvocation actionInvocation) throws Exception {
actionInvocation.invoke();
String actionClassName = actionInvocation.getAction().getClass().getName();
String actionMethodName = actionInvocation.getProxy().getMethod();
HttpSession session = ServletActionContext.getRequest().getSession();
return null;
}
}
Struts2 拦截器常用的获取Action、调用的方法名字、Session等
最新推荐文章于 2021-02-02 16:38:02 发布